Clint Rutkas (who is better than everyone) Twittered his distaste for Visual Basic and preference for C# today. Now C# is a great language and I really do think that the features they borrowed from Visual Basic (properties for example) make it the best of the C family of languages. Visual Basic also had edit and continue for years and years before C# developers were able to convince the Visual Studio that they wanted it too. But to me C# not as clean as Visual Basic. So of course I responded right away. This lead to an Instant Message conversation and discussion of a nerd off. So here now is my defense of Visual Basic. Clint’s opening statements are on his blog here.
I have never been a fan of C style languages. To me the use of the semi-colon and curly braces are crutches for the compiler writers and hindrances for programmers. If we were going to go that way we could have stayed with APL – a very powerful language but confusing for programmers. And they are ugly and confusing too!
The required semi colon is particularly a problem. How many times have programmers, especially but not exclusively beginners, terminated a loop accidentally by placing an extra, and hard to see, semi-colon at the end of a line? And a missing or misplaced closing brace is a lot harder to find than a missing End If. Contrary to Clint’s claims I maintain that the code samples he shows prove that VB is easier to read.
And then these is white space. In Visual Basic white space means something and enforces some organization of statements. You don’t see contests to see who can write the least understandable Visual Basic code as you do for C (and could do in C#). Just because it was hard to write doesn’t mean it should be hard to understand.
Oh and did I mention the My classes? Not strictly a language feature but they do make it very easy to do some powerful tasks in Visual Basic programs.