C#
Coding practise and design patterns.
“The great power comes with a great responsibility.“ C# as a powerful language has reduced the mistakes in Switch/Case flow control by removing the implicit fall-through behavior. That says you can not pass the compilation without an explicit statement at the end of each case, either a “break”, a “return”, a “goto”, or you can also detour the control flow by “throw” an exception. AS a matter of fact, you should always throw an out-of-boundary...
I couldn't stop laughting every time I'm reading this article. No matter it's truth or just a parody. I'm sure it'll give you a smile when you look back the years in your coding career. Check out the article: http://geekswithblogs.net/c... Even funier and/or scarier is that it sounds so real that many of my firiends and geeks here ask me if it's real when they read of it after my last post. :-DDD Happy coding...
David Chappell in his article “Understanding .NET's Common Type System“ explains “A basic difference between value types and reference types is that an instance of a value type has its value allocated on the stack, while an instance of a reference type has only a reference to its actual value allocated on the stack. The value itself is allocated on the heap“ http://www.awprofessional.c... This is the best comment I've ever read. I'd...
I had the discussions with my friends on this Statics & Thread Safety issues long time ago. It started with a weird “session swap” issue in one of our web application where we use “static” field to store the return value for an user profile int the data access component. The problem is only captured in a stress test but not unit test. That so reminds me another interesting topic on testing method I'd like to talk about in a seperate post. I see many developers new to C#...