VB.Net just doesn’t cut the mustard for me
by Mez on Jun.13, 2009, under Geeky, Personal, Rants, Rants
So, this morning (or yesterday morning, as it is now!), my attention got drawn to Wolfgang’s post regarding VB.Net. While I understand his point, I’m not too sure whether I agree with it in it’s entirity.
When I first started programming, I learnt how to write Basic. I don’t mean Basic as it stands nowadays, but Basic as it was back then (or should that be BASIC?). I learnt to code while I was wheelchair bound, as my father thought it’d be something interesting for me to do. It taught me the basics of programming, and I stemmed from there, moving on to learn Perl, then PHP, then C, etc etc etc.
The first time I ever wrote an application for a Modern computer, I wrote it in Visual Basic. I loved it. It was so simple to use, and I could use everything I’d learnt (apart from stuff like Music Envelopes etc etc) with ease in it.
Since then however, the world of programming has moved on. People have discovered Object Oriented programming, and found new and better ways of describing the data structures and logic behind an application. I have also moved on, I no longer write my own code in Visual Basic. I’ll generally use a tool more suited to the task.
I do, however, have to maintain some VB.Net code. In fact, it’s the code that Wolfgang mentions in his article. I can fully understand why the original subject’s response was “Urgh!” – the code is horrid.
I don’t neccesarily, however, think that this is because of the coders themselves. While this may have contributed (I’ve had many a “WTF” moment) – I think that the main problem behind it is the fact that it’s an Object Oriented design written in a language that’s tried to shoehorn Object Orientation into it’s core functionality, where the core functionality should probably never have had something like that done to it. It sits in my mind like some bad genetic experience resulting in some sort of mutated behemoth.
VB.Net, to me, just seems like a poorly made implementation of something it was never originally designed for. Wolfgang mentions that the ease of use of the Basic Language allows a user to start working without having to dive straight into OO programming, as would be forced onto you using something like C#, and in a way, I agree. The thing is, that Basic, as Wolfgang rightly said, is meant for beginners, after all, it was originally an acronym. “Beginners All Purpose Symbolic Instruction Code”. This, in my opinion, is where it should stay. Basic is great for beginners, and VB6 was amazing. But, the advent of VB.Net means that programmers are going to start writing OO code in Basic, something it was never designed for, and to that end, fall into pitfalls and misconceptions where they have been led to believe that the VB.Net way of doing something is the de-facto standard. When they come to start working in another language, they have to re-learn things from scratch. If their experience is in a corporate environment, then their skills are only transferrable to something also written in VB.Net, and rarely anything else.
Basic is for beginners, it was never designed for the more complex stuff, which should probably be left to languages that were designed to handle it.
6 Comments for this entry
1 Trackback or Pingback for this entry
-
Thank you to mez « Wolfie’s Coder Corner
June 16th, 2009 on 9:38 pm[...] I have a surprise when I looked at the stats! Mez’s pingback (click here to read) to my post about VB.Net caused a veritable storm in the water glass. In one day I had almost 400 [...]
June 13th, 2009 on 2:27 am
As the maintainer for the VB.NET compiler package in Debian, let me say: “urgh” is deserved, VB.NET’s a pile of crap, and I’d never advocate using it – but I don’t want to lock out people who use it
June 13th, 2009 on 2:40 am
Basic is an inferior language for beginners as well. I’m teaching my girlfriend programming this summer, since she starts a Library Science program in the fall and will probably have to do some. We checked out a couple of Computer Science 101 textbooks that use python as their main language. We’ve only done a few chapters but its gone fairly quickly. Much less painful from when I taught myself programming by spending the whole damn summer reading “Learn to Program C++ in 21 Days”.
So I think its a great beginner language. It has real OO, but you can also avoid defining classes and just use static methods to begin with. And having the interpreter is pretty much required for any beginning language in my opinion since its a great way to try out new syntax. Once she understands the programming basics I plan to introduce PyQt. This was the environment I actually originally learned Qt in.
So these days I don’t really see what role Basic has to play.
I suppose I do hold a similar opinion with Ada as you do with Basic. Ada was used as the language for my CS major, which I think was fine since its very structured and a very good procedural programming language. But then it got totally silly when one of the more advanced CS classes introduced OOP in the context of Ada. OOP is Ada is just freakin’ weird.
June 15th, 2009 on 4:25 am
The difference between C# and VB.NET is mostly syntax. Most of the code in VB.NET can be translated directly into C# code.
Public Class Line
Private mstrLine As String
Property Line() As String
Get
Return mstrLine
End Get
Set(ByVal Value As String)
mstrLine = Value
End Set
End Property
ReadOnly Property Length() As Integer
Get
Return mstrLine.Length
End Get
End Property
End Class
is far from different from
public class Line {
private string mstrLine;
string Line {
get {
return mstrLine;
}
set {
mstrLine = value;
}
}
int Length {
get {
return mstrLine.Length;
}
}
}
When you are discusing different languages VB.NET can be considered to be C# with a funny syntax. Sure there are minor differences between them but nothing that would make one or the other inherently worse than the other.
The isssue most people have with maintaining VB.Net code is that it’s often written bad programmers which is something the VB-community DOES have more of than for example C#.
Don’t blame the machines or the languages, blame the people responible for writing the piece of crap you are responsible for maintaining.
September 21st, 2009 on 4:26 pm
I’ll probably get banged because of the email address. So be it.
“Basic is for beginners, it was never designed for the more complex stuff, which should probably be left to languages that were designed to handle it.”
Ok, I’ll bite, what “complex” stuff are you addressing that is CLEARLY not doable in VB.Net but doable in say C#. Forget the Perls, C++, etc.
Oh, and when supplying an answer answer this question, “Of this so-called complex stuff not doable or as easily doable in VB.Net but trivial in C#, what amount of a an active working programmers life will require such sophistication?” How often does such really arise? And, can’t I effectively employ the C# gurus to write the small amount of “complex” stuff as necessary, while the majority is left to the sufficiently capable mundane handler of VB.Net? Unless you want to say that transitioning from VB.Net to C# is … well relatively trivial? Is that also the case?
Thanks
September 21st, 2009 on 4:58 pm
Bill S, put simply, as I’ve tried to put across, anything that is OO. Ok, it might do some basic stuff OO well, but if you get along the lines of inheritance, or anything remotely beyond just keeping variables in an object, it can get very complex, and really hard to understand.
Basic is designed as a linear programming language. Shoe-horning OO concepts into the language that’s not designed to be OO is never a good idea.
January 4th, 2010 on 11:06 pm
I started writing in BASIC, moved on to VB6, and now write in VB.NET. I love it. Sometimes I have to write in C# or even C++ for work and I always think how i could write the code faster or better in VB.NET. I even convinced my employer once to let me re-write a device driver in VB that was written in C++, and my driver ran faster. But VB.NET & C# are piratically the same language. Most of the time you just have to drop the semi-Colin and the code becomes VB. I also love using inheritance which I think is easy to understand in VB.