In an earlier post, I talked about how you can’t actually remove the reference to the Microsoft.VisualBasic assembly from a VB.NET project. This is kind of an addendum to that post because I still find way too many developers writing VB6 code in .NET. I know old habits are hard to break, but come on people, let’s do things the .NET way. In particular, I’m referring to all the VB6 methods that have equivalent .NET methods, such as UCase, LCase, Left, Mid, Right, UBound, Len, LTrim, RTrim, CStr, CInt, etc. – the list goes on and on.
All of these methods are simply wrappers to corresponding methods in the framework. For instance, LCase ends up calling ToLower and Mid calls Substring.
So this begs the question: why are developers still writing code this way? Well for one, Microsoft made it possible and way too easy. The jump for most VB6 developers to .NET is huge because of OO, so providing a comfort zone with familiar methods is understandable. But I also wonder if this is a culture thing for most VB developers? Do VB developers tend to shy away from the lower level details of the code they are writing? In my experience, yes. I also find that most VB developers tend to ask the question How? and not the question Why? I spend most of my time with VB developers, but I wonder if this is the case with developers in general.
If VB developers (and all developers for that matter) would ask the question “What’s really happening?” more often, I believe we’d find higher quality software and applications that are more reliable, more secure, better performing, and less buggy. And isn’t that the point of what we do anyway?
Print | posted on Sunday, February 08, 2004 11:27 PM