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

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

By Dan Mabbutt, About.com

6 of 6

Naming Variables

The the new language philosophy might be summed up in the maxim that VB.NET now forces you to "say what you mean and mean what you say" in your programming code. VB 6 makes a lot of guesses about what you really want if you don't actually code it and it's nearly always right. But when it's wrong it can cause horrible bugs. These bugs are avoided in VB.NET!

If you're reading other books or tutorials, the special note in our book, Variable Naming Conventions, deserves a little more explanation. Some authors think that a very strict variable naming standard is supremely important. You might see a style recommended where a variable might be something like ...

m_lngLineCount

... where m indicated that it was a Module level variable and lng indicated that it was a Long data type. But today, most authors feel that the improved ability of Visual Studio to help you keep things like this straight make this unnecessary and it is a lot of trouble to remember and use.

Another point to remember is that it's a VERY bad idea to use "cute" or "clever" names. Your goal as a programmer should be to keep things as transparent and easy to understand as possible. Early in my career, I was guilty of naming variables after my girlfriend, pets, and so forth. (Ah, to be young again!) Don't do it.

--please complete the text up to Using Variables to Store Input section of Chapter 5 now-----

Explore Visual Basic
By Category
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

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

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

All rights reserved.