typestar

Language basics

29 steps in 10 sets of Visual Basic.

Visual Basic taught more people to program than almost any language in history, and its modern .NET form keeps the quality that did it: code you can read aloud. Blocks end with words instead of braces — End If, End Sub, Next — keywords are ordinary English, and the punctuation budget goes to a handful of characters that earn their place. Under Option Strict it is a fully typed, compiled .NET language sharing the same runtime and libraries as C#, and it still runs an enormous share of the world's line-of-business software.

This tour covers the language itself: variables and interpolated strings, the core collections, Select Case, and the LINQ queries that VB renders more like SQL than any other language. Then Subs, Functions and lambdas, classes and interfaces, value types, and the idioms VB is known for — With blocks, named arguments, events. Files, exceptions and JSON close it out. Every seed compiles under Option Strict On before it reaches you.

Start this tour

Variables & strings

Collections

  • ArraysLiterals, 2-D grids and ReDim Preserve, VB's in-place resize.
  • List(Of T)The growable collection: add, insert, remove, sort.
  • DictionariesKey-value stores with TryGetValue, the lookup that cannot throw.

Control flow

  • If and ElseIfBlock Ifs, one-line Ifs and the If() operator that picks a value.
  • Select CaseOne value against many shapes of branch: lists, ranges, comparisons.
  • LoopsFor, Step, Do While and Do Until — every loop VB owns.

LINQ

Subs & functions

Classes & interfaces

Value types

  • StructuresValue types: copied on assignment, methods and all.
  • EnumsNamed constants, their integers, and [Enum] with brackets.
  • Generics and tuples(Of T) type parameters, constraints and named tuple fields.

VB idioms

  • With blocksOne object, many touches: the block that drops the repetition.
  • Nothing and NullableNothing checks, ?. chains and If() — VB's null-safety kit.
  • EventsEvent, RaiseEvent and the AddHandler wiring in one kettle.

Files & errors

  • FilesWrite, append, stream and delete through System.IO.
  • ExceptionsTry, a filtered Catch, Finally and a custom error of your own.
  • JSONSystem.Text.Json round trips for a class and a plain array.

Encore

  • Grade reportA complete program: query a dictionary, rank by average, letter it.
  • Inventory reorderA complete program: filter low stock, price the order, total it.

The other Visual Basic tours