Or, “How I Learned To Stop Worrying And Love The Code”. The main reason most programmers don’t use Visual Basic, is because most programmers don’t use Visual Basic. And aside from being easier to find more examples and tutorials in C#, more often and more importantly it’s about being easier to find a job. But toying with Visual Basic as a kid got me my first programming job, and making games is what compelled me to learn VB.
If anything, my reason for using VB for a game engine is almost because people don’t use it. If there were more good examples of code out there, more people would adopt it. Which includes some people who might never otherwise be able to wrap their mind around the unusual grammar and symbols of C#. Which includes myself.
I’ve read studies about the human brain that have shown distinct pathways for things like grammatical syntax and musical melodies. Ever since before Kindergarten we have all trained our minds to follow words in a certain order. And I find that when a language like Visual Basic also follows that natural order, I am able to work with concepts much more intuitively. With C-style grammar, I constantly feel as if my mind is looping back on itself. And that’s not just because I’m so used to VB, I’m also used to English grammar, just like everyone who says they’ll never learn to code.
This year, in learning modern OpenGL, I’ve had to learn the GLSL Shader Language, which is probably the most elegant form of C-style code I’ve ever used. This is where the C syntax really shines. I genuinely would not want Visual Basic syntax for Shader Code. It just wouldn’t feel right. But this is hardware level stuff, not the interface and database level, where Visual Basic belongs.
I almost have to go so far as to say that this isn’t my opinion, it’s my brain’s opinion. When you’re trying to code “straight to the metal”, as John Carmack once put it, of course C-style is King. But when you’re dealing with higher level data stuff, you want the language to be as verbose as the concepts you’re working with, and less symbols making it look like mathematical formulas when it isn’t.
For instance, my beef with
<Angle Brackets>. In HTML syntax you’re never using the
You might have a String with HTML in it, and Statements with
<= Operators, but you didn’t have variables like
List<String> Foo or
Dictionary<String, String> Bar. At that point, you’re using a Comparison Operator as part of a Variable name. I have tried so hard to get past it, but that syntax just short-circuits my brain.
Our minds have been trained to look at words and read them to us. One part of our mind actually speaks and another hears it. But symbols don’t have sounds behind them. The extra words in Basic give code a natural rhythm, so when you read
Dim Foo As List(Of String) and
Dim Bar As Dictionary(Of String, String), your mind keeps jumping from one word to the next.
When I was younger I appreciated the conciseness of C-style, but that was back before auto-complete was so robust. Nowadays the Visual Studio IDE does so much of the typing work for you, the idea of writing code that doesn’t look good or read well is just not worth the effort. You only have to write code once, but not only are you going to read it many times over, someone else will probably have to understand it too.
The best kind of code compiles as smoothly in the coder’s mind as it does in the compiler. Writing good comments takes a lot of effort, and that effort is better spent on better coding. Such as putting more effort into coming up with the right names for objects. The more obvious anything is, the better. It’s only when an algorithm gets extremely intricate that I resort to writing comments.
Above all though, there really is no technical difference with VB or C# at all. Visual Basic is not limited in what it’s capable of, only in where it’s used. But now that Microsoft is developing things like Dot Net Core, compiling code on Windows in Visual Basic is no longer limited to running on Windows platforms.
Even if it was scientifically proven that C-style language is the “wrong way”, because it contradicts spoken grammar, I know it would still be preposterous to say that everything should change. But likewise, there are different ways of thinking, and to say that VB users should be forced to put up with symbol heavy language is just as unfair.
There’s no reason to discourage someone from using VB if they wouldn’t want to learn coding otherwise. I wouldn’t enjoy coding half as much if I was stuck with C#. Some people might never consider coding at all until they see a project like this, and that’s part of the point of JEOZ. If there’s one good example of a VB game engine, it could spawn many projects and tutorials, making any argument against VB null and void. That is to say,
Sub, but now I’m just being a smartass.
As I tried to say in one of my first posts, I’m not going to dwell on one language versus another. But I have to answer the inevitable question, so here it is. I doubt I’ll do any more posts dedicated to this subject.