Saturday, June 12, 2010

Visual Basic.NET an Aberration?



Aberration: a state or condition markedly different from the norm; a disorder in one's mental state; an optical phenomenon resulting from the failure of a lens or mirror to produce a good image… (http://www.wordreference.com/definition/aberration)

Is visual basic really an aberration? Aberration, because it uses “begin” “end” instead of { }? because the language has, more or less, 136 keywords? because a program written in VB looks like a novel? because it makes programmers be bad programmers? because it is for beginners? because you think is the old BASIC which used GOTOs? or my favorite one, because you hear someone else (professor, guru, tech celebrity or a friend) said that? Whatever your reason is, I totally disagree. Visual Basic is not even close to be an aberration, it is not for beginners, if a programmer is a bad programmer it is because of him and not because of the language, it is not just BASIC and finally, If someone told you that VB.NET is not good, I would say “use it!” and then decide by yourself.

Visual Basic is just another cool high level language, it is very successful and you can build any type of (high level) application with it, has great support and libraries and I even dare saying that the Syntax “look” looks great! Just have a look by yourself in the following OOP Hello World! program written in VB.NET:

Public Class Greet
    Dim name As String
    Public Sub New(ByVal name As String)
        Me.name = name(0).ToString().ToUpper() & name.Substring(1, name.Length - 1)
    End Sub

    Public Sub Salute()
        Console.WriteLine("Hello, {0}!", name)
    End Sub
End Class

' Greet the world!
Module GreetModule
    Sub Main()
        Dim g As New Greet("world")
        g.Salute()    ' Output: “Hello, World!”
    End Sub
End Module

Aberration? I show you what an aberration looks like to me: Brainfuck (http://en.wikipedia.org/wiki/Brainfuck)

Yes, it looks more or less ok, but I don’t like that “End” keyword because looks ugly or is a waste of typing. I just don’t like to type. Good news for you! Get a copy of Visual Basic.NET 2010 and start typing; you will see that the IDE editor types all the Ends for you! No, seriously, again it is just syntax, there are lots of languages using the “End”, “@end”, “end;”, “end.” keyword in their syntax such as Ruby, SQL, Delphi Prism, Zonnon, and also Objective-C  , and I haven't read or heard anyone saying those languages are aberrations, so please do not say VB.NET is bad because its keywords.

Visual Basic is not for beginners; Small Basic is. “Microsoft Small Basic puts the "fun" back into computer programming. With a friendly development environment that is very easy to master, it eases both kids and adults into the world of programming.” Taken from: (http://msdn.microsoft.com/en-us/beginner/ff384126.aspx)

So, what do you think people? Why do you think Visual Basic is bad? What do you like or dislike about it? I’m very interested in your answers! :)



Some sites of interest:
Visual Basic.NET history:  http://en.wikipedia.org/wiki/VB.NET


2 comments:

  1. I'm VB .Net programmer as C#, Java and others with less power as PHP or AS and yes I hear a lot of times things like "VB is for begginers", "it make you lazy", etc. but I guess that is the power of VB, you can left coding for a while and when you back is like if you never left it, is easy to remember and the VS with the intellisense make a lot of things for you and additionally as you mention it's powerful you are able to do a lot of
    things.

    I'm agree that a simple method become in lot of code but what is the problem? I want the system working the quantity of lines of code is just
    vanity.

    ReplyDelete
  2. Thanks for your comment Pinkys
    I would love to hear from people that say such things and what are their reasons :)

    And stay tuned because you will see that the version of Hello World! program in VB.NET I showed is not the one with more lines of code!

    ReplyDelete