Wednesday, May 18, 2005

VB.NET vs C#.NET

There's an interesting discussion happening at work at the moment about VB vs C# code. My thoughts:

VB as a language was designed to abstract a lot of complex functionality so that the programmer didn't have to "bother" with it. This is great for small and simple applications. It provided a great platform for developing small applications quickly and efficiently.

C++ however doesn't try to hide detail (although later libraries such as the STL started to edge in this direction). So you have more power and control, but also an increased level of complexity. So it took longer to produce a simple application but is more capable for a complex application.

So from my point of view, the comparison is between ignoring complexity and knowing, at a deeper level, what was actually happening when you call a function with a reference parameter. Knowing how memory is managed and how pointers work. Coz this stuff is still important, no matter how much .NET tries to hide from you.

I don't think there is any difference in VB or C# code. The only differences nowdays (.NET) is the syntax.

However, there is a big difference in code written by someone how 'gets' how the low level operations work and someone who doesn't. This is, to me, the essence of the (unfair IMO) categorisation of VB programmers and C++/# programmers. The categorisation is based on where you came from. If you started working with C++ you probably understand this stuff, or you wouldn't have cut it as a C++ developer. If you started working with VB, you didn't have to do that. Mind you, that doesn't necessarily mean that you don't get it... there's no reason that a programmer starting with VB is any less capable of understanding what's going on under the hood.

Joel on Software has an interesting article about Leaky Abstractions that also illustrates this issue. It's pretty long, but it's almost certainly written better than this (admittedly long-winded) post :)

No comments: