Disclaimer: I respect everyone’s right to use their own programming language. I also respect the accomplishments of certain languages and realize not one language can suite all the needs in the world. That is why we have functional languages and SQL and so forth. This is my opinion and my opinion only.
Sir Alfred has challenged me to a nerd off. On twitter, (http://twitter.com/crutkas), I smarted off about my love for C style languages and my coworker, Alfred Thompson(http://blogs.msdn.com/alfredth/), responded in his always well thought out, respectful manner disagreeing with me.
Long story short, I ran into a code translation issue that caused a CLS error when I translated working, non-erroring C# to VB.Net and it got me worked up again on why I dislike VB.
So let us go into why C style languages are the bomb. Here is some c#
void foo()
{
if(bar() == 10)
{
return;
}
else
doMoreWork();
}
VB:
Sub foo()
If bar() = 10 Then
Return
Else
doMoreWork()
End If
End Sub
Very quickly looking at this pseudo code, we know clearly where it ends and starts due to brackets. If I wanted to make the code tighter, I can move the brackets up (this is another coding style war debate). I don’t need the brackets if I choose to in the example of doMoreWork(). My source isn’t cluttered with “EndFor” and “EndIf”. I see a bracket, I know I’m at the end. No “if () then endif”.
By enforcing things like parenthesis for if statements, you get a clear reading for what is inside. I know (bar() == 10) is the whole statement. I can’t misread it since I know that there will be a ) then a {.
Also, by being more “airy”, I can read it quicker. It doesn’t read like the Tale of Two Cities. I can skim and poke, rather than put on my reading glasses and think “it was the best of times, it was the worst of times” and then want to fall asleep no mater how many Dr. Peppers I drank.
When I do run across VB only examples, I transcode them using a few different converters. Right now I think the Telerik convertor is one of the better ones out there. http://converter.telerik.com/
While I know Alfred will respond since he won’t let a young whipper snapper like myself off the hook but if anyone does agree or disagree, feel free to comment.