Remember those posters that said "Today is the first day of the rest of your life"? Well, that's true of every day but one -- the day you die. -- Lester Burnham (Kevin Spacey)

Every rule has an exception.

Like the general rule that it is a bad idea to hard code strings in a call to MessageBoxW -- you should always load the string from resources so that your localizer has the opportunity to translate the text.

This is a very good and sensible rule, and it was just yesterday that several of us were reviewing bug descriptions that were entered to the bug database by a tool that detects such problems.

But while looking through the valid reports of bugs that various developers were going to have to fix, we found one case that is the exception to this rule.

This good and sensible rule.

Can you guess what it might be?

The one time that this rule isn't true?

Some people might think it is an ASSERT function. Good guess, but no. That isn't it.

The exception is when the error is something like this one:

Catastrophic Error: Unable to load message.

And the call comes after the attempt to load the error string in question fails.

This is a great exception to the rule.

I mean, is there ever a better time to point that we could hardly expect a developer to load that message from a resource....

Though to be honest there is a flaw in this specific description of otherwise unassailable logic.

Can anyone guess what that flaw might be?

 

This blog brought to you by(U+29ee, aka ERROR-BARRED WHITE SQUARE)