Put simply: “YOU DON’T” so quit trying. Just today: http://stackoverflow.com/questions/5806520/parse-email-header-with-regex-in-c http://thedailywtf.com/Articles/Email-Validation-Validity.aspx Why people insist on attempting this is beyond me. I’ve grown to really like Regex, I’ve even built a light-weight xml parser on regular expressions but you can not parse email addresses with a regex. Just look at some of these crazy attempts in [...]


There are three virtual methods that IMHO should have never been added to System.Object… • ToString() • GetHashCode() • Equals() All of these could have been implemented as an interface. Had they done so I think we’d be much better off. So why are these a problem? First let’s focus on ToString(): 1. If ToString() [...]


The answer is simple… only when the profiler tells you to. Optimizations often make code less reliable and often constrain implementations making them less flexible. Good software performance is not created by making lots of micro optimizations throughout your code. A good design from the architectural point of view is the critical key to success [...]


This ‘helpful’ (using this term loosely) post is for those you considering adding multi-threaded code to your application.  The intended audience is developers with less than mastery-level (10+ years) multi-threading experience. The first question your up against is: Do I need multi-threading in my application? The answer is an emphatic NO you don’t.  If you accept this [...]


I was viewing the comments on a recent post entitled Integration Tests Are a Scam when I ran across this: Integration tests are needed A Mars rover mission failed because of a lack of integration tests. The parachute subsystem was successfully tested. The subsystem that detaches the parachute after the landing was also successfully (but [...]


I recently posted a question about the use of readonly on stackoverflow. Follow the link to see the comments on Thoughts on the use of readonly for any/all instance members of a class? For some time now I’ve been using the readonly modifier for nearly all class fields. I use it for List members, IDisposeable [...]


If statements in code, need I say more. I know most of you out there get it (and yes, if statements are not the only way to branch code, but they are the worst offender IMHO). I just seem to be lucky enough to continue to find code riddled with if statements. Why don’t these [...]


I’m just laughing my @$$ off at this one: AntiPaste, because Pasting Code Is Harmful I couldn’t have said it better myself. If I could remove Ctrl+C/Ctrl+V from the keyboards of every junior developer the world would be a better place. Though this solution might be a bit extreme, the lesson it’s trying teach is [...]