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 [...]
Sometimes a picture is worth a thousand words… I simply ‘cringe’ every time I hear a developer utter the words “I’m going to do this RIGHT!”. Why do we use the words “Right way” and “Wrong way” when describing things? The fact is that there is a lot more than just one “Wrong way” to [...]
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 [...]
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 [...]
I’ve been reviewing a lot of blog sites lately reguarding testing and unit test practices. One I ran across this morning entitled “Extract and Override refactoring techinque” caught my eye on Taswar Bhatti’s Blog. Don’t get me wrong here, I tried to read this objectively and understand where he was coming from; however, I am [...]
This is the one, the only, the quintessential rule to programming. AKA, the KISS method (Keep It Simple Stupid) is, to me, words to live by. From the implementation of a simple class to the design of a complex application you constantly have to keep this in the forefront of your mind. Far too often I [...]
Found an interesting post over on ISerializable – Roy Osherove’s Blog that outlines a few of the things that should be considered when designing software component interfaces. To re-summarize and add my own two cents worth here they are in my own order of importance. Resilience – (the best single-word description I can come up with) [...]