I can’t explain the redirect, but once I added the missing new keyword everything was back to normal. This happened in a much more convoluted situation which made the missing keyword harder to spot. I guess it goes to show that you shouldn’t try to be clever, even when “just writing an unit test”.
This is one of my pet peeves. Language with prolific use of the underscore character. I have many times looked at Ruby to see what all the fuss is about and never gotten past all those damn underscores. I will never use a language that relies on underscore as a word boundary.
Underscore is not a space, it doesn’t look like a space so why bother trying? Instead it breaks logical units such as variable names or function names into units that may or may not belong together. By skimming I cant tell if that is a . (dot) deference or just a pseudo word boundary. Further more it slows down typing because you have to move your fingers way out of the normal flow.
Camelcasing is tried, tested and found divine, stop messing with it.
Next week, possibly a rant on the curly bracket character, and why it is impossible to type reliably on scandinavian keyboards. Stop using it too!
Our customer has a e-mail campaing system that sends out around 30.000 opt-in emails to its customers every now and then. Nothing spectacular but it handles keyword substitution, independent operation for long running tasks, some pretty wild cyrillic texts.
Recently though sending newsletters to customers with non ASCII characters in their names stopped working, something which did work before, the only recent changes were some added tracing instructions and exception handling.
Calling the ToString() method before ToEncodedString() (which is called when sending the message) will pollute the MailAddress internal state with an unencoded version of the address that is returned as a cached version on subsequent calls to ToEncodedString().
Turns out some of the added tracing code printed out the address of the receiver it was processing at the moment, triggering the bug in the framework.
Now, if I could only find somewhere to report this…