1. Home
  2. Computing & Technology
  3. Visual Basic

Chapter 5 - VB.NET Language and Syntax - Part 1

By Dan Mabbutt, About.com

5 of 6

The Dim Statement

The DIM statement is probably the best place to start our "bootcamp" forced march through VB.NET language syntax because it's the most fundamental. But there's more to it. Nothing illustrates the new philosophy of .NET better than the changes that have been made in declaring variables.

The book mentions that DIM is short for Dimension. This goes wa-a-a-y back to the earliest days of Basic (before "Visual" Basic). In fact, it goes back to the even earlier language Fortran. So, although you might think using a word like DIM isn't too bright (pun intended), it's used because there is just too much history now to change it.

The Upgrade Notes: What's New in Visual Basic .NET page in the text mentions that Option Explicit is now the default in VB.NET; that a new statement, Option Strict has been added, that VB 6 Variant variables are no longer allowed. These are ALL changes in how variables are declared. The underlying change behind all of them is that the designers of VB.NET decided that the immediate and short-run benefits of being really easy to code (the VB 6 philosophy) ar simply less important than the long-run benefits of being a really solid, structured language with fewer ways for bugs to creep into your programs.

Consequently, there is much less that is assumed and automatic in VB.NET. If you need a variable in your program, you have to tell VB.NET that you need it and what kind of variable it is.

5 of 6

Explore Visual Basic

More from About.com

  1. Home
  2. Computing & Technology
  3. Visual Basic
  4. Learn VB.NET
  5. VB.NET Language and Syntax

©2008 About.com, a part of The New York Times Company.

All rights reserved.