Comment On GenerateApologyMessage()

"We came across this trying to sort out why the application never threw errors which said what the problem was," Tom writes, "I wouldn't have minded (much) but the random number generator was something to behold." [expand full text]
« PrevPage 1 | Page 2 | Page 3Next »

Re: GenerateApologyMessage()

2012-03-14 14:38 • by Gurth
376866 in reply to 376844
ubersoldat:
Why should software apologize?

Maybe the person who wrote it was trained on Microsoft Bob? In which case, the software would probably need to apologize.

Re: GenerateApologyMessage()

2012-03-14 14:38 • by PiisAWheeL
376867 in reply to 376860
Anon:
Arantor:
Is it wrong that I might actually consider this for non-serious errors, mostly as a form of easter egg? (i.e. for errors that should never appear in production but that if they do, it's just tripping a safety net, and would actually still list the real error underneath)


No. Its not wrong. You should definately implement this. And you should definately keep the part where Now.Millisecond is partitioned into ten options. Because splitting it into two would not make it random enough.
You need MOAR!!! Moar error messages to confuse the user. That way when they get like 3 different error messages in a row they will think that there is a different problem causing them.

Re: GenerateApologyMessage()

2012-03-14 14:40 • by PiisAWheeL
376868 in reply to 376862
Melnorme:
Two words: Female programmer
As sexy as that sounds... what you're saying is she shoulda stayed in the kitchen?

Re: GenerateApologyMessage()

2012-03-14 14:51 • by Nagesh
Random error messages are introduced for purpose of leting client beleive that something euniquely different occur in computer each time. This way client think, he has wonderfull system

Re: GenerateApologyMessage()

2012-03-14 15:14 • by Gary (unregistered)
376871 in reply to 376853
You are in a maze of twisty passages all alike.

Re: GenerateApologyMessage()

2012-03-14 15:16 • by Gary (unregistered)
376872 in reply to 376871
Gary:
You are in a maze of twisty passages all alike.

Plugh! Someone posted this already.

Re: GenerateApologyMessage()

2012-03-14 16:02 • by whatevs (unregistered)
376873 in reply to 376835
Starship Catan.

Re: GenerateApologyMessage()

2012-03-14 16:19 • by Secret (unregistered)
376874 in reply to 376835
ObiWayneKenobi:
One of the errors should have been: "It's a sad thing your adventure has ended here!"

Props if anyone knows what that's from.



You have died of cholera.

Re: GenerateApologyMessage()

2012-03-14 16:22 • by Schrödinger's cat (unregistered)
376875 in reply to 376865
Throck:
Greetings from the future. Your olden ways are fascinating. Just think this to your synthetic personal assistant, and it'll update your code for you:

Private Function GenerateApologyMessage() As String
Return If(Qubit.Collapse, "Whoops! Something went slighty awry...", "How embarassing, I seem to have failed that task!")
End Function

It returned .

Re: GenerateApologyMessage()

2012-03-14 16:28 • by dkf
376876 in reply to 376830
Zunesis: Nothing Less Than The Best:
String[] array = (String[]) list.toArray();
Now I know you don't write Java code for a living.

Re: GenerateApologyMessage()

2012-03-14 16:50 • by Gneius (unregistered)
376877 in reply to 376814
Netherous:
Altourus:
If (number % 200 < 100)
ErrorMessageFrist
else
ErrorMessageTwo

??


Silly noob, you need to get an instance from RandomErrorMessageApologyGeneratorFactory and attach the MillisecondDomainPartitioningBehavior and give it your callbacks to ensure your code is flexible and robust enough for the enterprise environment.


These two classes look a bit too tightly coupled in concept for my liking. I think the core logic needs to be factored out into implementation(s) of a TimeDomainDrivenErrorMessageGenerationStrategy interface, then the Behaviour object can probably be pared down to a simple collection of key/value pairs.

Re: GenerateApologyMessage()

2012-03-14 17:02 • by Darkstar (unregistered)
376878 in reply to 376875
In fact, this has already been covered by Damian Conway (notable perl hacker) with the module Quantum::Superpositions.

Re: GenerateApologyMessage()

2012-03-14 17:03 • by Jimmy (unregistered)
376879 in reply to 376841
Andrew:
Ignoring the attempted randomisation, I just hate those would-be-cute error messages. Unfortunately they even crop up in supposedly professional software, e.g. Firefox when it can't recover from an aborted session: "Well, this is embarrassing". Developers - just say no.
I dunno, I used to love tar (yes I know it's not an error message, but same principle):
"Cowardly refusing to create empty archive"

Also IIRC, many of the Sierra Games used to crash with:
"You did something we didn't expect"

Re: GenerateApologyMessage()

2012-03-14 17:04 • by Mick (unregistered)
376880 in reply to 376835
ObiWayneKenobi:
One of the errors should have been: "It's a sad thing your adventure has ended here!"

Props if anyone knows what that's from.
Pick-A-Path/"Choose your own adventure" books?

Re: GenerateApologyMessage()

2012-03-14 17:18 • by Gunslinger (unregistered)
376881 in reply to 376819
Arantor:
Is it wrong that I might actually consider this for non-serious errors, mostly as a form of easter egg? (i.e. for errors that should never appear in production but that if they do, it's just tripping a safety net, and would actually still list the real error underneath)


As long as you have more than 2 error messages when there's 10 cases, sure, it's all good.

Re: GenerateApologyMessage()

2012-03-14 17:41 • by Gunslinger (unregistered)
376882 in reply to 376876
dkf:
Zunesis: Nothing Less Than The Best:
String[] array = (String[]) list.toArray();
Now I hope you don't write Java code for a living.


FTFY

Re: GenerateApologyMessage()

2012-03-14 18:17 • by The Great Lobachevsky
376885 in reply to 376880
Mick:
ObiWayneKenobi:
One of the errors should have been: "It's a sad thing your adventure has ended here!"

Props if anyone knows what that's from.
Pick-A-Path/"Choose your own adventure" books?


Was it Shadowgate? I remember my adventure ending in that a lot, mostly involving falling into pits and such :)

Re: GenerateApologyMessage()

2012-03-14 19:18 • by Matt Westwood
It certainly beats the "Oh bugger" that used to spontaneously appear at the bottom of the screen when running a program that appeared on my list of programs to maintain and upgrade a few years ago.

When I reprogrammed it to get the error to explain itself, disappointment was raised by all the people who would never again be graced with the delights of "Oh bugger" when they fatfingered the input. Silly buggers.

Re: GenerateApologyMessage()

2012-03-14 21:33 • by Anonymous Coward (unregistered)
376888 in reply to 376827
Still seems over-engineered.
return System.currentTimeMillis() / 100 % 2 == 0 ? "Whoops!  Something went slighty awry..." : "How embarassing, I seem to have failed that task!";

Re: GenerateApologyMessage()

2012-03-14 22:02 • by CZeke (unregistered)
376889 in reply to 376819
Arantor:
Is it wrong that I might actually consider this for non-serious errors, mostly as a form of easter egg?


Not at all -- but for the sake of sanity, at least calculate the millisecond only once. This guy probably thought he was setting up the equivalent of a switch() structure, but instead it's a sieve: the first error message has a 10% chance of triggering, the second has a 20% chance, and so on, all independent. It needs a variable, like the GWBasic version posted upthread. If you're gonna do the wrong thing, do it correctly!

Re: GenerateApologyMessage()

2012-03-14 22:32 • by FuBar (unregistered)
If Now.Millisecond = 666 Then

Return "Be afraid. Be very afraid."

Re: GenerateApologyMessage()

2012-03-14 23:03 • by oheso
376891 in reply to 376865
Throck:
Greetings from the future. Your olden ways are fascinating. Just think this to your synthetic personal assistant, and it'll update your code for you:

Private Function GenerateApologyMessage() As String
Return If(Qubit.Collapse, "Whoops! Something went slighty awry...", "How embarassing, I seem to have failed that task!")
End Function


Fool! This function is not multiverse-safe!

Re: GenerateApologyMessage()

2012-03-14 23:15 • by click
376892 in reply to 376836
towel:
Zunesis: Nothing Less Than The Best:
boog:
Fixed?

...<snip>...

return list.get(System.currentTimeMillis() % list.size());
What, are you just going to let all that memory get eaten up by using an ArrayList? You've got a lot to learn, nub:
...<snip>...

return array[System.currentTimeMillis() % array.length];


Ha! 293 million years from now, when System.currentTimeMillis() returns a negative value, your indexes will be out of bounds. Prepare to have your code posted here.


So, -7 % 2 != 1?

Re: GenerateApologyMessage()

2012-03-14 23:22 • by Mick (unregistered)
376893 in reply to 376892
click:
towel:
Zunesis: Nothing Less Than The Best:
boog:
Fixed?

...<snip>...

return list.get(System.currentTimeMillis() % list.size());
What, are you just going to let all that memory get eaten up by using an ArrayList? You've got a lot to learn, nub:
...<snip>...

return array[System.currentTimeMillis() % array.length];


Ha! 293 million years from now, when System.currentTimeMillis() returns a negative value, your indexes will be out of bounds. Prepare to have your code posted here.


So, -7 % 2 != 1?


in Java, -7 % 2 = -1 I think....

Re: GenerateApologyMessage()

2012-03-14 23:26 • by Mick (unregistered)
376894 in reply to 376893
Mick:
click:
towel:
Zunesis: Nothing Less Than The Best:
boog:
Fixed?

...<snip>...

return list.get(System.currentTimeMillis() % list.size());
What, are you just going to let all that memory get eaten up by using an ArrayList? You've got a lot to learn, nub:
...<snip>...

return array[System.currentTimeMillis() % array.length];


Ha! 293 million years from now, when System.currentTimeMillis() returns a negative value, your indexes will be out of bounds. Prepare to have your code posted here.


So, -7 % 2 != 1?


in Java, -7 % 2 = -1 I think....
http://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.17.3

Akismet blows dead goats fallopian tubes

Re: GenerateApologyMessage()

2012-03-15 00:31 • by Stivlo (unregistered)
376896 in reply to 376809
Your solution is not as efficient as the original code, but nice try.

I would have enjoyed more messages, like 'I tried my best, but I failed, sorry', 'I've to confess that the task didn't go the way I planned', 'I messed this one up, I am so sorry!', 'Apologies, the task was aborted'

Re: GenerateApologyMessage()

2012-03-15 03:37 • by The Darned (unregistered)
Shouldn't we suspect ambiguous requirements: it probably said "give a different message for each error condition."

Admittedly the solution doesn't quite do that.

Re: GenerateApologyMessage()

2012-03-15 04:42 • by daef (unregistered)
376899 in reply to 376888


return System.currentTimeMillis() / 100 % 2 == 0 ? "Whoops! Something went slighty awry..." : "How embarassing, I seem to have failed that task!";



i smell a off-by-1-error there - didn't check thou since i am lazy by nature (=> i code for livin')

Re: GenerateApologyMessage()

2012-03-15 05:37 • by dkf
376900 in reply to 376882
Gunslinger:
dkf:
Zunesis: Nothing Less Than The Best:
String[] array = (String[]) list.toArray();
Now I hope you don't write Java code for a living.
FTFY
No, I meant exactly what I said. That code snippet above will never work. It will always produce an exception, every single time. I know how to fix it, but that's not the point: any Java coder who has ever used toArray() has encountered this, and it's one of the most annoying misfeatures of the type-system. (Damnit, I know why it is this way and I can see clearly how every step into this sinkhole was taken, but it's still stupid!)

Re: GenerateApologyMessage()

2012-03-15 06:04 • by Nagesh
Usual case when people keep shift from PHP to PERL to PYTHON to JAVA to C# to VB.NET, confusion occuring on massive scale in brain.

Without compiler it is difficult to sort out problem. Real programmer using Notepad and avoid this issue of mixed languages.

In real world, I use Hindi word while speaking in English. Happens every day. Now lets go jaldi-jaldi on next topic please.

Re: GenerateApologyMessage()

2012-03-15 06:23 • by Musaran
Aren't random, useless error messages an industry standard ?

Re: GenerateApologyMessage()

2012-03-15 08:18 • by BitDreamer (unregistered)
376905 in reply to 376835
ObiWayneKenobi:
One of the errors should have been: "It's a sad thing your adventure has ended here!"

Props if anyone knows what that's from.


According to Google, it's from a website called TheDailyWTF.com. Check it!

Re: GenerateApologyMessage()

2012-03-15 08:19 • by asmand (unregistered)
376906 in reply to 376835
ObiWayneKenobi:
One of the errors should have been: "It's a sad thing your adventure has ended here!"

Props if anyone knows what that's from.


Shadowgate?

Re: GenerateApologyMessage()

2012-03-15 08:38 • by Patrick (unregistered)
376907 in reply to 376813
Anketam:
PiisAWheeL:
RuBen:
"How embarassing, I seem to not be frist!"
Whoops! Something went slighty awry...
How embarassing, you seem to have failed that task!
Whoops! Commenting went slightly awry...

Re: GenerateApologyMessage()

2012-03-15 08:51 • by ObiWayneKenobi
376908 in reply to 376874
Secret:
ObiWayneKenobi:
One of the errors should have been: "It's a sad thing your adventure has ended here!"

Props if anyone knows what that's from.



You have died of cholera.


No, that's Oregon Trail.

The correct answer is Shadowgate.

Props to anyone who got it :D

Re: GenerateApologyMessage()

2012-03-15 09:06 • by Al (unregistered)
Nice that it keeps system testers busy.

Is this a repeatable error? Sometimes. OK, possibly a separate defect for each error message. I'll raise one for each.

---

Anyway, forget the apology. How about including a message that tries to shift the blame and accuses the user of system mis-use? Maybe with a reminder that all errors are logged and reported?

Re: GenerateApologyMessage()

2012-03-15 09:42 • by Ben Jammin (unregistered)
376912 in reply to 376910
Al:
Nice that it keeps system testers busy.

Is this a repeatable error? Sometimes. OK, possibly a separate defect for each error message. I'll raise one for each.

---

Anyway, forget the apology. How about including a message that tries to shift the blame and accuses the user of system mis-use? Maybe with a reminder that all errors are logged and reported?


I like accusatory validation on user input i.e. "Email address is invalid" changes to "Do you not really know your email address? Have you not really learned to tpye? We're blocking your IP cause obviously you are one of 'those' clients who is gonna be clogging all our support lines."

(yes, in that instance tpye would be purposeful)

Re: GenerateApologyMessage()

2012-03-15 10:29 • by Brogrammer (unregistered)
376913 in reply to 376868
PiisAWheeL:
Melnorme:
Two words: Female programmer
As sexy as that sounds... what you're saying is she shoulda stayed in the kitchen?


Just like Bachmann. Wonder what ol' Crazy Eyes is up to nowadays...

Re: GenerateApologyMessage()

2012-03-15 10:35 • by boog (unregistered)
I'm pretty sure Alex needs to write a GenerateApologyMessage() method for the days he can't get this site up and running or I'll pound his face.

Re: GenerateApologyMessage()

2012-03-15 11:49 • by a nonny mouse (unregistered)
376925 in reply to 376914
boog:
I'm pretty sure Alex needs to write a GenerateApologyMessage() method for the days he can't get this site up and running or I'll pound his face.


Is that a new .net language? "hisface#"

Re: GenerateApologyMessage()

2012-03-15 11:58 • by frits
376926 in reply to 376914
boog:
I'm pretty sure Alex needs to write a GenerateApologyMessage() method for the days he can't get this site up and running or I'll pound his face.
I'm pretty sure you don't know what "up and running" means. Your not to smart, are you?

Re: GenerateApologyMessage()

2012-03-15 12:01 • by PiisAWheeL
376929 in reply to 376926
boog:
I'm pretty sure Alex needs to write a GenerateApologyMessage() method for the days he can't get this site up and running or I'll pound his face.

The Daily WTF (top left corner of the site):
Louisville, KY - see you at Code PaLOUsa (Mar 15-17)
Read Much?

Re: GenerateApologyMessage()

2012-03-15 12:02 • by PiisAWheeL
376930 in reply to 376925
a nonny mouse:
boog:
I'm pretty sure Alex needs to write a GenerateApologyMessage() method for the days he can't get this site up and running or I'll pound his face.


Is that a new .net language? "hisface#"
Wtf is "hisface sharp"?

Re: GenerateApologyMessage()

2012-03-15 12:43 • by blank (unregistered)
376935 in reply to 376827
boog:
Fixed?


java.util.ArrayList<String> list = new java.util.ArrayList<String>();
list.add("Whoops! Something went slighty awry...");
list.add("How embarassing, I seem to have failed that task!");
return list.get(System.currentTimeMillis() % list.size());


probably being trolled, but the frist thing to hurt my eyes was the declared type being anything more specific than java.util.List

Re: GenerateApologyMessage()

2012-03-15 13:26 • by KattMan
376942 in reply to 376912
Ben Jammin:
I like accusatory validation on user input i.e. "Email address is invalid" changes to "Do you not really know your email address? Have you not really learned to tpye? We're blocking your IP cause obviously you are one of 'those' clients who is gonna be clogging all our support lines."

(yes, in that instance tpye would be purposeful)


I actually had an instance once to do something like this. There was an executive manager that would constantly try to delete something, get the popup asking if he is sure, always saying yes, then suddenly realizing what he did and come running in to us to fix it. Of course the system just marked it as deleted, without really delting it so recovering was easy.

On the next release he found something interesting.
He tries to delete a record, it asks if he is sure, he clicks yes, then it asks if he is posistive, then absolutly sure, then unequivically certian, then politly denied him the right to delete said record. He had to have his secretary do it for him. We triggered this only on his user id so no one else saw it.

Took two weeks before the next release came out so he could get back to normal and he rarely ever had his "mistakes" again. He was actually a good guy to IT, he saw the humor in it and laughed about it later with us.

Re: GenerateApologyMessage()

2012-03-15 15:39 • by Kivi
376959 in reply to 376942
KattMan:

There was an executive manager that would constantly try to delete something, get the popup asking if he is sure, always saying yes, then suddenly realizing what he did and come running in to us to fix it. Of course the system just marked it as deleted, without really deleting it so recovering was easy.

This is why we need robust undo functionality. Confirmation dialogues may make us feel good but they just don't quite work as intended, do they? Users either waste time trying to navigate them, or they learn to always click yes and end up like your executive manager, at some point clicking yes when they ought to have clicked no. And by users I mean all of us!

In this case, since you were already using soft deletions, an undo feature should have been fairly straightforward to implement.

Re: GenerateApologyMessage()

2012-03-15 16:26 • by KattMan
376967 in reply to 376959
Kivi:
KattMan:

There was an executive manager that would constantly try to delete something, get the popup asking if he is sure, always saying yes, then suddenly realizing what he did and come running in to us to fix it. Of course the system just marked it as deleted, without really deleting it so recovering was easy.

This is why we need robust undo functionality. Confirmation dialogues may make us feel good but they just don't quite work as intended, do they? Users either waste time trying to navigate them, or they learn to always click yes and end up like your executive manager, at some point clicking yes when they ought to have clicked no. And by users I mean all of us!

In this case, since you were already using soft deletions, an undo feature should have been fairly straightforward to implement.

I agree, would have been easy, but they did not want it, imagine the chaos, people randomly deletign and undeleting at will! The undo feature was in our hands only, it was called a SQL script, though undoing mistakes made by that would have been far more difficult.

Re: GenerateApologyMessage()

2012-03-15 21:19 • by oheso
376973 in reply to 376910
Al:
How about including a message that tries to shift the blame and accuses the user of system mis-use? Maybe with a reminder that all errors are logged and reported?


I see you're familiar with PowerSchool.

Re: GenerateApologyMessage()

2012-03-16 03:47 • by Indigo (unregistered)
376979 in reply to 376862
Melnorme:
Two words: Female programmer
Oh, you're so right!

They'd really need someone like that to prevent such awful code.

Re: GenerateApologyMessage()

2012-03-16 08:31 • by KattMan
376986 in reply to 376979
Indigo:
Melnorme:
Two words: Female programmer
Oh, you're so right!

They'd really need someone like that to prevent such awful code.


I know right, havign a female programmer walk in would stop all code from being written as the male programmers all stop and stare in disbelief. Then of course everyone gets back to work once they realize it's just Jim in drag.
« PrevPage 1 | Page 2 | Page 3Next »

Add Comment