Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should exception messages that are targeted to the developer be localized?

I am referring to exception messages that show the developer is incorrectly using an API. For example incorrectly passing a null to method. So the type of exception that the developer will get the first time they have run their incorrect code. The type of exception message that should never get to be displayed to the user of a system.

This is kind of related to the theory that since the programming language is in English then the programmer already has an understanding of English. Or at least enough to decipher an exception message.

http://www.codinghorror.com/blog/archives/001248.html (please no discussion of this theory here)

And yes I know that the .net framework follows the "localize everything" approach.

like image 865
Simon Avatar asked May 30 '09 11:05

Simon


2 Answers

Your question can be rephrased as "should all developers get the same error message so that they can Google it?" ;)

And the answer to that is yes.

Translation means that

  • the message is no longer the same as whoever wrote the API intended. It might carry the same meaning, or it might have lost something in translation. It might be badly translated, and in some cases it might be downright unreadable.
  • Whoever reads it can not simply type the error into Google and see what everyone else who got this error did. Because everyone else got the same error in a different language.

About .NET's "localize everything" approach, it is horrible. I've been tripped up by it countless times, especially because if it is unable to find the localized resource, it does not give you the plain English version. It gives you a "Could not locate resource" error instead, effectively throwing away the actual error information.

like image 63
jalf Avatar answered Sep 21 '22 06:09

jalf


No, I don't think they should be (or at least we don't do it, and we're pretty big :-). There's enough effort involved in localizing all the stuff that users see without having to worry about developers as well.

There are no mainstream languages that support foreign language keywords and standard libraries so a rudimentary command of the English language is already a pre-requisite for developers.

Of course, if developers develop their own libraries (or language), they're quite at liberty to localize or choose a non-English language.

like image 22
paxdiablo Avatar answered Sep 18 '22 06:09

paxdiablo