I’ve had a problem with the CInt, CDbl, CWhatever casts in VB.NET from day one. Maybe it’s just because I dislike VBScript so much that something carried over to .NET. I must admit that my preference goes to C# for it’s cleanness. The .NET framework was developed from ground up and this approach made it possible to start over and get rid of of the baggage which accumulates during the years a technology exists. Now why would you go ahead and add some of the baggage back in by adding VB6 compatibility on top in the form of VB.NET?
Understand me right, VB.NET is great but one of the things which bugs me about VB.NET are the choices made to keep many of the weird little “features” of VB6 in VB.NET. VB.NET is different in so many important aspects that it’s almost painful to think that anyone in their right mind would keep the little weirdnesses in for the sake of existing developers. I mean come on, they had to learn all kinds of OOP techniques, patterns, and so forth, why wouldn’t you just get rid of the weird stuff?!
Dustin Aleksiuk gives a great example you should be aware of if you are using VB.NET: The CInt cast. Take a few seconds and draw up in your mind the way you think it works. I almost guarantee you that the actual implementation will surprise you.
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.