views:

327

answers:

5

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.

Thanks

A: 

It all depends on who is going to maintain the code. If the developers will always be English, then it makes sense to keep it all in English.

Furthermore, I'm not sure if the .NET Framework throws its error messages in a localized way. I always thought those error messages are always in English, so then it would make sense to keep your internal error messages in English as well.

tomlog
from the constructor of NullReferenceExceptionpublic NullReferenceException() : base(Environment.GetResourceString("Arg_NullReferenceException"))and here is someone asking how to turn off localization for exceptionshttp://stackoverflow.com/questions/721337/forcing-english-language-exceptions-in-net-framework
Simon
+3  A: 

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.

paxdiablo
+8  A: 

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

And the answer 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.

jalf
Actually jal that is not what i was asking. I was thinking purely from the point of getting the developer to understand what they have done wrong. But it is a very good point that I had not considered. +1
Simon
@jalf, I think that's why every IBM product has message numbers (e.g., DRL0122I), even though the error text itself may be localized. You can always search on the message number regardless of the language.
paxdiablo
@Pax: True, and a good point. That solves half the problem (allowing people to google it), but not the part about actually understanding the error in the first place. Unless the original developer is fluent in the target language, your translation is unlikely to be perfect.
jalf
Sorry, @jalf, I wasn't trying to say they should be localized (my own answer says no as well). Just that that's what IBM does for their user messages (which *are* localized) as well as their developer ones (for consistency I guess even though the messages are all English).
paxdiablo
I know what you meant, sorry if it sounded like I disagred. :)
jalf
A: 

At our firm we allow exceptions/error messages to be translated for our compiler/IDE and supply the framework to translate these exceptions/error messages however we don't do the translation ourselves. Then it is up to the customer to translate if he wants to. There are a number of countries where English isn't that popular and where the own language is promoted. Therefore it makes sense to allow for translated error messages.

Anders K.
An erro message is not the same as an exception message. Exception messages are for developers. Error messages are for users. Error messages should be translated. Exception messages should not be translated. I don't care what management says.
Martinho Fernandes
A: 

If you translate your exception messages, than you should also translate all the texts where exception messages occur. That includes any knowledge base or bugtracking system you have, because users and programmers will want to search them for the exception message they see on the screen.

Niki
Users don't want to search for exception messages. Users cannot possibly be expected to understand what "Object reference not set to an instance of an object." means, even in their native language. Actually it seems a little silly when seen from a non-programming perspective.
Martinho Fernandes