Profile picture
Long Pham
November 3, 2024

Why VB.NET might be better than what you think it is

First of all, this post is anything but absolute facts. It is my personal opinion on why I think Microsoft's Visual Basic is a good language and why I enjoy using it in my day job. Having different views on a programming language is very common and it's good to read counter arguments (sometimes). Hfhf!

Before we go into the world of Visual Basic (I'll refer to it as VB), it is a high-level strongly-typed OOP language created to build applications with the .NET framework. It is not to be confused with the popular VBA language, whose main purpose is to embed in Office applications (Excel, Access, e.t.c).

So, what is so worth considering of this 20+ years old language that looks like a clone version of Python with less features? First of all, the collection of features it offers. The amount of built-in features for VB.NET feels just right for me. Not too much that it turns into a feature hell in C++ is trying to be, but not as limited as C (sorry to the C freaks out there). Along with its features, I find the syntax very verbose and English-like.Β For example, generic syntax is written as so in VB.NET:
vb.net
Imports System.Collections
' This is how you create a list of int
Dim listOfInt As New List(Of Integers)
Obviously, the generic version with XML-like tags are also understandable and it symbolizes generic type, I just find the VB syntax really neat in this particular instance. For reference, this is what I was talking about:
typescript
// A list of number in TS
const arr = new Array<number>();
Secondly, VB.NET is quite performant. I have worked on multiple desktop app projects written in VB.NET and it has been able to keep the performance of the application to the level that the company rarely receives performance complaints. And on those rare occasions, it has been traditionally someone writing stupid code (loading objects one by one instead of just one single query). Honestly, who wouldn't want a language whose code looks clean accompanied with fast compile time.

One thing I find underrated about the .NET business is that the event-driven nature of WinForm applications. It was designed very elegantly and it speeds up the development process rapidly. A typical event handler in VB.NET can look like this:
vb.net
Imports System.Windows.Forms
' Handle text changes for TextBox1 element
Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
    Console.WriteLine("Content of text box: " + TextBox1.Text)
End Sub"'
The sender parameter contains relevant information about the element that triggered the event. This is not important in our context but it is helpful when we have shared event handlers functions that handle events for multiple components. The e object provides the context of the event. The keywords themselves are very much explanatory and there's hardly any explanation needed for anyone to understand what the code is doing here.

Though I cannot say that a lot of people agree with my opinion, but it has been a pleasure so far to work with VB.NET. I do think it's an underrated options for developers who are into desktop app (Windows, specifically). If that person is you, do check it out πŸ˜‰

Β© 2025 Long Pham. All Rights Reserved.