Daily Archives: April 19, 2014


Programmers: How Not To Write An Error Message

A friend called me to say that he could not play one of the YouTube videos on my blog.  It would play for a few seconds and then he would get a message “An error occurred”.  Along with the error message there were all sorts of suggestions as to what he could do to fix the error, but none of them worked.

I had him repeat to me the exact words of the message.  Googling youtube an error occurred was enough to find the problem.  I found the web page The dreaded “an error occurred” message shows on *every* YouTube video.

Eventually, it turned out that my friend did not have any speakers nor headphone connected to his computer, and that was the problem.  This was mentioned in the thread about the error. I realized that if the YouTube message had said something like “An error occurred, I could not find the sound device,” he could have solved his problem himself without any need to call me.

This leads me to one of the prime principles that I held to as a programmer.  If you are  going to write an error message about an error that has been detected, you owe it to  the user to tell him or her exactly what was the error that you detected.

Maybe the YouTube folks thought that they were being nice by telling you what things you might try in order to fix the unidentified error.  The trouble is that no programmer can imagine all the things that might go wrong, nor all the reasons for them to go wrong.  If you tell the user exactly what it was you detected, then the user may know what he or she did to cause the error.  Or the user might consult with someone who would understand the details of the error as described in the message.

When my friend told me that he had no speakers or headphones, my natural question was “Why would you do that?”  He explained why he used headphones and not speakers and that he was just testing to see if he could watch the video before he plugged in his headphones.  It was certainly a reasonable explanation, but not something I would have ever imagined.  Which brings me to another oft heard response from other programmers  when I insisted on good error messages and also allowing people to do things that you would never imagine them wanting to do.  I would hear the old dreaded question, “Well, why would anybody want to do that?”  My answer was “I have no idea, but what harm does it  do if you to let them do it?”  I had found over the years that customers could find amazing things to do with your program that you never dreamed of.

The error message issue is related to the question of “Well, why would anybody want to do that?”   The related question is “What would anybody do with this information if I gave it to  them?”.  The answer is similar.  “I don’t know what they might do, but why not tell them anyway?  Would it kill you?”


Nebraska School Faces Heat on Facebook for Bullying Message 2

The Las Vegas Guardian has the story Nebraska School Faces Heat on Facebook for Bullying Message.

9 rules for handling bullies

I was incensed when I read this story yesterday.  What kind of message does the principal of the school send when she writes comments such as “Would we keep our friends if we tattled on them?” and “It’s the person who retaliates or responds, who actually starts the fight” and “No one likes a sore loser”?

I can see giving advice on how to stand-up to a bully, but blaming the victim is exactly the wrong attitude.  Standing up to a bully may be reasonable advice to someone who can do it.  However, for someone who is not capable of doing it, making that person feel inadequate is only to double the pain.  It leaves the victim feeling alone and unprotected by the very people who should be responsible for protecting him or her.

In fact, a victim might be better able to stand-up to the bully if he or she knew that the adults in the world would also stand-up for the victim if the situation were to get out of hand.

You can tell how well a person has internalized this stupid message by their reactions to criminal behavior as adults.  Look at the Whitey Bulger case in Boston.  Some adults are more incensed that Bulger might have been an informant for the FBI than they are incensed by the murders he committed and the terrorism that he used in Boston.  The way that the FBI protected their informant may also be a reflection of internalizing the stupid message.  The FBI seemed more concerned about their informant than they were about the victims.  Although it may just have been a case of plain old corruption in the FBI.

This idea that it is abhorrent to be a snitch is something that needs to be stamped out. If the principal of the school in Nebraska cannot show that she has learned how seriously wrong her attitude is (not just that the wording is wrong), then she ought to be fired.