Sometimes It Pays To Cover All Bases
-
The problem is rooted in
Daniel Pfeffer wrote:
the underlying variable is an int (or another integral type)
If enumeration was a first class type, "++weekday;" (given Daniel Pfeffer's enum definition) would generate a runtime error, similar to a numeric overflow exception. Unless, of course if the enumeration type allows an enum to be defined as cyclical, in which case the new value would be SUNDAY.
Nelek wrote:
That doesn't generate error here... we start the week on Monday
First: I think that goes for all of Western Europe nowadays. We (Norway) changed from Sunday to Monday as the first day of the week something like 40-50 years ago to be in harmony with other European countries. As the English term is 'weekend', and Sunday is part of the weekend, I always assumed that Sunday ended the week in English speaking countries. I was surprised to learn that while this is true in GB, in the US of A it appears that the week ends one day before the weekend ends. A little nitpicking: Different cultures disagree about the first day of the week. If you make software for use in multiple cultures, you cannot (or at least should not) replace the enum definition when you start marketing the software in a new region; that could result in subtle errors. Rather, the enum definition should be completely ignorant of which value is considered to be the position of the air valve on the rotating wheel. So, Daniel Pfeffer's definition is perfectly OK, even in Europe, assuming that his application code never makes any assumption about the first enum value being the first day of the week. Given that enum is not a first class type, the code would correctly go to the default case even in Europe. If your language allows: Overload ++ for the weekday type, to make weekday++ == SUNDAY when the old value of weekday == SATURDAY. Then it doesn't matter.
Religious freedom is the freedom to say that two plus two make five.
You missed the "joke" icon... didn't you?
M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.
-
You missed the "joke" icon... didn't you?
M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.
At least a couple of points were dead serious: I really wish that today's programming languages had enumerations as a first class type, not just as a thin veil over an integer 'base type'. Cyclical enumerations would be an obvious modifier. Second: I am dead serious when claiming that a far too high fraction of programmers ignore cultural differences in their coding. Stressing that the first enumeration value is unrelated to first day of the week is no joke. Yet you frequently see that kind of implicit assumptions in code. Overloading ++ (and --, and for that sake plain + and -) to make an enum type cyclical is no joke. So although I wrote it as a follow up to your joke marked entry, I wanted to point out that there are connotations to the joke that are not just a joke, but serious matters. Unfortunately, I have never found an English translation of one of the Danish poet Piet Hein's 'gruk' (he made up that term for his short, pointed words of wisdom), the one that goes, in my very un-poetic from-the-top-of-my-head translation: He who sees a joke as just a joke and seriousness always seriously, he really understands them both rather poorly. If I had flagged my post as a joke, I fear that a lot of readers would have failed to notice that the major points of my post are dead serious.
Religious freedom is the freedom to say that two plus two make five.
-
I do the user interfaces in our commercial ink-jet printing systems. There are more than 1,000 error messages defined, a number of which are "programming errors". A programming error is one where the code detects an error condition (out of memory, say) and then just throws up its hands and gives up. To quote Peter Griffin from Family Guy, these really grind my gears. All of these get directed to a generic message "An internal software failure has occurred. Please contact your service representative (
_symbol_
)" where_symbol_
identifies the actual error. More generally, error messages should identify the problem and guide the user to a solution: "Sensor A is out of calibration; adjust parameters A1, A2, and/or A3 to measured values." Even if the solution is to restart the application or the entire machine, this is what your users need for you to do. Telling them "It's broke" and thinking they'll just know how to fix it is contemptible.Software Zen:
delete this;
Gary R. Wheeler wrote:
ink-jet printing systems
:omg: That is even worse than working for the dark side. :-D So Gary, are you then able to explain what the 1.2Gb of driver software for a printer are for ? Could you delete the code for programmed obsolescence, the code that prevents me from scanning when my cartridges of violet ink are empty, the code that voluntarily prints out a "test page" every other day, the code that requires me to register online to print a word document on my local pc, recompile, and send me the resulting 200kB .dll ? :rolleyes:
-
Gary R. Wheeler wrote:
ink-jet printing systems
:omg: That is even worse than working for the dark side. :-D So Gary, are you then able to explain what the 1.2Gb of driver software for a printer are for ? Could you delete the code for programmed obsolescence, the code that prevents me from scanning when my cartridges of violet ink are empty, the code that voluntarily prints out a "test page" every other day, the code that requires me to register online to print a word document on my local pc, recompile, and send me the resulting 200kB .dll ? :rolleyes:
Our printing systems are a little larger scale than that. We can print full color duplex at 17 feet of paper per second and systems run $1.5M-2.5M. That said the desktop folks learned the basics of their business model from us. Our machines sell relatively close to cost. We make money on ink (which comes in anything from 5L cubes to 208L drums to 1000L pallet containers), printhead refurbishment (a $50,000 printhead can be refurbed for much less), and service. The corporate bullshit about defeaturing scan when you're low on ink, disabling black printing when you're low on color, etc. isn't specific to ink-jet. It's any excuse to nickel-and-dime the customer. It's an attitude that once you've bought the machine you're a captive customer. What they don't realize is that when you're printer is <$100 and your ink is $25-$40 per cartridge the customer doesn't give a :elephant: who makes their printer. If you piss them off, they will buy something else. I used to be an HP loyalist because at one time their hardware was good and their ink cartridges lasted for months with my casual usage. Not any longer. The recent batch of malware/adware from HP was the last straw. I tossed out my HP printer and bought a Canon instead. If Canon turns out be untrustworthy in some way, I'll switch to something else.
Software Zen:
delete this;
-
Our printing systems are a little larger scale than that. We can print full color duplex at 17 feet of paper per second and systems run $1.5M-2.5M. That said the desktop folks learned the basics of their business model from us. Our machines sell relatively close to cost. We make money on ink (which comes in anything from 5L cubes to 208L drums to 1000L pallet containers), printhead refurbishment (a $50,000 printhead can be refurbed for much less), and service. The corporate bullshit about defeaturing scan when you're low on ink, disabling black printing when you're low on color, etc. isn't specific to ink-jet. It's any excuse to nickel-and-dime the customer. It's an attitude that once you've bought the machine you're a captive customer. What they don't realize is that when you're printer is <$100 and your ink is $25-$40 per cartridge the customer doesn't give a :elephant: who makes their printer. If you piss them off, they will buy something else. I used to be an HP loyalist because at one time their hardware was good and their ink cartridges lasted for months with my casual usage. Not any longer. The recent batch of malware/adware from HP was the last straw. I tossed out my HP printer and bought a Canon instead. If Canon turns out be untrustworthy in some way, I'll switch to something else.
Software Zen:
delete this;
Gary R. Wheeler wrote:
We make money on ink (which comes in anything from 5L cubes to 208L drums to 1000L pallet containers),
Reminds me of a price list I saw many moons ago for toner cartridges for the HP Laserjet III: Prices was stated for 1 unit, 12 units, a pallet (I believe that was 144 units), and then a truckload of toner cartridges. (Deep in my old paper archives there is a xerox of that price list, but it is too deep down for me to dig it out tonight to check how many units a truckload was. I believe it was in the order of 8000 units.)
Religious freedom is the freedom to say that two plus two make five.
-
I had a message "What part of 'failed' don't you understand?" as a default in something... until a new boss came along and didn't like.
The boss was right - sarcasm in error messages is rarely helpful (thus contrary to their purpose) and suggests arrogance on the author's part, so is best avoided.
-
From Reader's Digest of about 50 years ago. (Much before Google) Somebody visited West Germany for the first time, and saw signboards of 'Ausfahrt' at many places, and was initially of the idea that Ausfahrt is huge city, to which all these roads lead. However no place called Ausfahrt was found on the map. Only later did he find out that Ausfahrt means Exit.
To be fair, which is exactly where all those signs led!😉
-
From Reader's Digest of about 50 years ago. (Much before Google) Somebody visited West Germany for the first time, and saw signboards of 'Ausfahrt' at many places, and was initially of the idea that Ausfahrt is huge city, to which all these roads lead. However no place called Ausfahrt was found on the map. Only later did he find out that Ausfahrt means Exit.
To be fair, which is exactly where all those signs led!😉
-
Hi All, Have been writing a front end for a piece of test equipment we designed in house to test a product which is a subassembly of another bigger (>£ or $). The subassembly is a questionable design but...I was told when writing the software these are the limits. Of course they change on a per-hour basis as the designers have copied some elses home work and don't really understand the issues so that get shoved in an ini file that can be edited via notepad. Too higher readings covered, too low readings covered & pass covered, ask the question whatelse does the unit output, 'nothing' add a catch for anything else. Basically a message box that says "Somethings Wrong, Check Part" someone who knows better looks over my code and says "Well, thats options a waste of time, but you have deployed it now, you will have to roll that mod back the next update we do!", Yesterday morning one of the operators reported a rig failure with a "message you haven't shown us" mass hysteria, morning meeting derailed, Senior leadership all tramp down to see issue. The message box on the screen is
Quote:
Somethings Wrong, Check Part
:wtf: I then have to explain infront of every one the rig has seen an error I have told not to check for & was told to remove as it was point less. You close the port and reopen the port and the issue is solved. "Why wasn't the operator told what to do with this error", my reply "Well I was told the error couldn't happen", think I was for it got told I had done the correct thing, "I'll have a word" waiting for the outcome now :)
I'm reminded of the work we did for SEPTA (South Eastern Pennsylvania Transit Authority). We did the computer aided dispatch system which had to communicate to the trains via packet radio. When they showed us the protocol they wanted to use I just about died. No error check, no ACK/NAK. Asked them how we were supposed to test the protocol they said they were going to use a VT100 terminal to type in the messages. I proposed a better protocol and told them we would design an emulator so we could emulate the entire train system. Then there was one big bugaboo....they had to be able to connect dispatch to all the train's audio systems for emergency announcements and such. I told them they needed a broadcast message and they said "no". I also explained to them that with the ACK/NAK protocol and single train connections it would take up to 30 minutes to get all the trains connected and another 30 minutes to disconnect them (all during which the live dispatch radio system is connected to train speakers). I put this in writing to them. They said "we aren't going to fix it". Around 3 years after we delivered the system they called us and blamed us for the 30 minute delay. I had to haul out the letters between us to show them we warned them.
-
Hi All, Have been writing a front end for a piece of test equipment we designed in house to test a product which is a subassembly of another bigger (>£ or $). The subassembly is a questionable design but...I was told when writing the software these are the limits. Of course they change on a per-hour basis as the designers have copied some elses home work and don't really understand the issues so that get shoved in an ini file that can be edited via notepad. Too higher readings covered, too low readings covered & pass covered, ask the question whatelse does the unit output, 'nothing' add a catch for anything else. Basically a message box that says "Somethings Wrong, Check Part" someone who knows better looks over my code and says "Well, thats options a waste of time, but you have deployed it now, you will have to roll that mod back the next update we do!", Yesterday morning one of the operators reported a rig failure with a "message you haven't shown us" mass hysteria, morning meeting derailed, Senior leadership all tramp down to see issue. The message box on the screen is
Quote:
Somethings Wrong, Check Part
:wtf: I then have to explain infront of every one the rig has seen an error I have told not to check for & was told to remove as it was point less. You close the port and reopen the port and the issue is solved. "Why wasn't the operator told what to do with this error", my reply "Well I was told the error couldn't happen", think I was for it got told I had done the correct thing, "I'll have a word" waiting for the outcome now :)
I found this very hard to read.
-
Hi All, Have been writing a front end for a piece of test equipment we designed in house to test a product which is a subassembly of another bigger (>£ or $). The subassembly is a questionable design but...I was told when writing the software these are the limits. Of course they change on a per-hour basis as the designers have copied some elses home work and don't really understand the issues so that get shoved in an ini file that can be edited via notepad. Too higher readings covered, too low readings covered & pass covered, ask the question whatelse does the unit output, 'nothing' add a catch for anything else. Basically a message box that says "Somethings Wrong, Check Part" someone who knows better looks over my code and says "Well, thats options a waste of time, but you have deployed it now, you will have to roll that mod back the next update we do!", Yesterday morning one of the operators reported a rig failure with a "message you haven't shown us" mass hysteria, morning meeting derailed, Senior leadership all tramp down to see issue. The message box on the screen is
Quote:
Somethings Wrong, Check Part
:wtf: I then have to explain infront of every one the rig has seen an error I have told not to check for & was told to remove as it was point less. You close the port and reopen the port and the issue is solved. "Why wasn't the operator told what to do with this error", my reply "Well I was told the error couldn't happen", think I was for it got told I had done the correct thing, "I'll have a word" waiting for the outcome now :)
Not to worry... Even AI is getting fed up with stupid Humans. In one incident, a user asked the AI a question and the response was, "Figure it out yourself..."
Steve Naidamast Sr. Software Engineer Black Falcon Software, Inc. blackfalconsoftware@outlook.com
-
I did some programming for a German Engineering Company. I quickly learned that clarity of error messages counted alot and for good reason as many of the users were not engineers and were just average folks. "Gemütlichkeit" was their catch phrase for "user friendly" software at the time (80-90's). Language can be a tricky thing, at times. Once I was in large German department store during holiday. It was quite crowded. Waiting in a line some folks broke up the line by wandering through. I could not think of the German phrase for "excuse me there is a line here", so I blurted out "Achtung" (attention). The crowd parted like the Red Sea. My German companion laughed and said they thought I was a policeman directing them to "make way". Live and learn. Bottom line, "error messages are quite important".
"A little time, a little trouble, your better day" Badfinger
jmaida wrote:
error messages counted a lot and for good reason as many of the users were not engineers and were just average folks.
Could somebody tell Microsoft, please? PLEASE?
Telegraph marker posts ... nothing to do with IT Phasmid email discussion group ... also nothing to do with IT Beekeeping and honey site ... still nothing to do with IT
-
Great story! Reminds me of Blinkenlights[^]. :laugh: ACHTUNG! ALLES TURISTEN UND NONTEKNISCHEN LOOKENSPEEPERS! DAS KOMPUTERMASCHINE IST NICHT FÜR DER GEFINGERPOKEN UND MITTENGRABEN! ODERWISE IST EASY TO SCHNAPPEN DER SPRINGENWERK, BLOWENFUSEN UND POPPENCORKEN MIT SPITZENSPARKEN. IST NICHT FÜR GEWERKEN BEI DUMMKOPFEN. DER RUBBERNECKEN SIGHTSEEREN KEEPEN DAS COTTONPICKEN HÄNDER IN DAS POCKETS MUSS. ZO RELAXEN UND WATSCHEN DER BLINKENLICHTEN.
When I was 14 (early 70s) I broke my leg whilst on a school skiing trip, in Austria. Was taken pronto to the Bezirkskrankenhaus (well, it made me laugh, even at the time). I was on a trolley in a corridor (yes it happened even then, in Austria!) and a lot of medical-looking people came by and tried to establish from me what was wrong. About 4 or 5 failed to communicate (I knew zero German) and wandered off. Eventually I had inspiration (memory of some old war film, I think) and the next one that came along, I just pointed to my leg and said (slowly, loudly and clearly of course) "Ist kaput". That's all that was needed - got whisked through and treated within minutes. :laugh:
Telegraph marker posts ... nothing to do with IT Phasmid email discussion group ... also nothing to do with IT Beekeeping and honey site ... still nothing to do with IT
-
I found this very hard to read.
I found it hard to understand, software error don't like, remove error, get general Windows error, like even less, try to explain error message useful was removed.
-
The boss was right - sarcasm in error messages is rarely helpful (thus contrary to their purpose) and suggests arrogance on the author's part, so is best avoided.