Introduction to Visual Basic

1.1 What is Visual Basic?

Visual Basic is Microsoft's beginner-friendly, English-like programming language. It descends from BASIC (1964).

VB.NET (2002+) is a fully object-oriented language on the .NET platform. It compiles to the same IL (Intermediate Language) as C#, so it has the same performance and the same libraries.

It's known for readability (If ... Then ... End If), case-insensitivity, rapid application development (RAD), and drag-and-drop GUI design.

1.2 History

Visual GUI design for Windows Database access (Jet) 32-bit, classes

Native compilation, ActiveX/COM. VB6 is the most popular classic version.

VB.NET 7.0.NET rewrite: full OOP, inheritance, exceptions

Generics, My namespace, operator overloading, Using, IsNot

LINQ, XML literals, lambdas, type inference, extension methods, anonymous types

Implicit line continuation, auto-properties, multi-line lambdas, collection initializers

Async/Await, iterators (Yield), caller info attributes

Roslyn compiler, ?., NameOf, string interpolation $"", multi-line strings, read-only auto-properties VB 15.x (2017)

Tuples, binary literals, digit separators, ref returns (consume), Private Protected VB 16.x (2019–2020).NET Core support, comments after line continuation, Optional with ByRef... latest is 16.9 (init-only property consumption)

1.3 The Visual Basic Family

.NET Framework /.NET 5–10 Supported (stable language) VBA (Visual Basic for Applications)

Supported (macros in Excel, Word, Access, Outlook) IDE unsupported since 2008, but the runtime still ships with Windows Windows Script Host, classic ASP

Deprecated (being removed from Windows)

1.4 What You Can Build with VB.NET

Windows desktop apps (WinForms, WPF), console tools, class libraries, Windows services/worker services, web APIs (ASP.NET Core with limitations), Office add-ins (VSTO), database applications, automation scripts, and games (MonoGame with some effort).

1.5 VB.NET vs C#

Both compile to the same IL, use the same .NET libraries, and interoperate fully (a VB project can reference a C# library and vice versa).

VB-only features: XML literals, the My namespace, Handles/WithEvents, Select Case with ranges, optional/named parameters (C# has these too), late binding with Option Strict Off, Like operator, When exception filters (earlier than C#), query Aggregate syntax.

C#-only (newer) features: records, pattern matching, Span<T> authoring (ref structs), source generators (authoring), nullable reference types, primary constructors, and more.