Or, “The TOP 5 THINGS you will NOT BELIEVE they are adding to Visual BASIC!”. And I hesitated to do this, but I’m pretending to click-bait to prove my point. I probably won’t do it ever again. In fact I swear I’ll never ever do it again if you are about to stop reading.
I’m not about to say anything important anyway, this is an opinion. The point of this article is that there are a couple of simple modifications that could be done to Visual Basic that would instantly win over C++ and C# users who are on the fence about VB. After being a fanboy of Visual Basic since VB3 for Windows 3.1, I think my opinions are worth considering but feel free to stop me. I know that long-time C users won’t convert, and it would be foolish to try. But if anything, I have to write at least one article about the subject, so it’s covered, and I can move on to more important things such as anything else.
The other point of this post is that my blog is new and needs some more content. But I am not going to spend time criticizing languages I don’t even use, or rant about why I don’t use them, or just praise Visual Basic for being “superior”, because “the best programming language” does not exist anyway. And the difference between VB and C# is only syntax, it’s the same exact core.
So instead, I’ll fire shots at my own favorite language, and act as if my years of experience somehow give me the right to dictate how it should be modified. Then the subject of rival programming languages is covered, and I can avoid it like the plague and/or cheap desperate click-bait titles like this one.
- VB support for C++ style comments. I can’t imagine why treating “//” like VB’s apostrophe comment would be an issue. And while I don’t know anything about the internals of a compiler, from my ignorant viewpoint I can’t see why /* multi-line comments */ would be difficult to implement. VB should have one anyway, so whether it’s difficult doesn’t matter. If anything it’s good that it doesn’t already have one that’s different from C, so they can just start using the standard.
Visual Studio has toolbar buttons to comment or uncomment multiple lines, but sometimes I like to toggle a block of code off and on quickly. In C# I would put /**/ before and after the block, and delete the second “/” to toggle the comment.
For now I just use my favorite line of code of all time: “If 1 = 2 Then”. Switching that line to “1 = 1” will “uncomment” the block of code.
Something like “If 1 = 2 And Logic = Nothing Then Sigh() AndAlso FacePalm()”.
Syntax Error Line 8: Invalid punchline.
- VB should ignore semi-colons at the end of lines and grey them out, or just remove them automatically, instead of raising errors. And on multi-statement lines, switch them to a colon, which is VB’s multi-statement character. Pasting C# code should be as effortless as possible if you expect long time C programmers to convert to VB.
- C# and C++ coders think “Dim” looks silly. And despite my lifetime of using Dim a hundred kabillion times, I agree. But I also thought C#’s “Var” was silly when I first saw it, but I quickly got over the mental syntax errors that it gave me at first.
Var can be used somewhat in a similar manner: “Dim x = 1” is the same as “Var x = 1”. The difference is Dim is used for Dimensioning any type, like “Dim i as Integer”.
The simple fix is to just add the word Var to do the same thing as Dim. While you’re at it, add the word Let. I’d rather use “Let i As Integer = 0” than Dim or even Var. Dim sounds dumb. At least Var gives you some idea of what it does. Some VB users might not even know Dim means Dimension. And spellcheck doesn’t even know what “dimensioning” is.
But “Let” is even more obvious, and it’s not abbreviated. And VB is all about readability. Let’s go with Let.
I can’t think of anything else at the moment, and that’s only 3, so the “TOP 5” sub-title was also inaccurate click-bait. But that’s because I’m not going to act like any kind of authority on this, I am only starting this list.
I know my dumb little opinion about your language of choice doesn’t matter to anybody, not even myself, I don’t want to get into any arguments about language preferences. The point of this is to suggest simple changes that would make Visual Basic better for everyone. And to help ensure it’s a language of choice, rather than “because everyone else uses it”.
I hope that encouraging Visual Basic isn’t seen as a bad thing to C# users. Getting more people into programming is a good thing, regardless of what language they choose. I know I wouldn’t love coding nearly as much if it weren’t for a language that works better with my brain. So there could be quite a few potential coders out there who might finally get into it if they knew how much I love VB, yet can’t seem to force myself to feel the same about C#. Different keystrokes for different folks.
Perhaps the issue for some people is that if it’s too easy, it may open the door to invite in a bunch of mediocre programmers. After all, VBScript was so easy to use it resulted in the ILOVEYOU virus. Modern security will never allow that again though, so let’s dispel the connection to VB. It could’ve just as easily been done in C#Script if it existed way back then. Not that I don’t blame Microsoft, but you can’t blame VB itself.
If anyone has any more to add to the list, I would love to hear them. But then again, hardly anyone uses Visual Basic, so the only response I might get from this article is crickets.
Anyway, I’ll repeat myself: I don’t need to say more than this one blog post on the subject of language syntax. I use Visual Basic because I simply love it. Whatever you code with, more power to you.