Datasheet
P1: GIG
WY006-01 WY006-Sample WY006-Sample-v3.cls January 29, 2004 17:49
Welcome to Visual Basic .NET
Figure 1-18
Try I t O ut , you had named your label Name1 and your textbox Name2—you would very quickly become
confused. How about if you left your application for a month or two and then came back to it to make
some changes?
When working with other developers, it is very important to keep the coding style consistent. One of the
most commonly used styles used for controls within application development in many languages is
Modified Hungarian notation. The notion of prefixing control names to identify their use was brought
forth by Dr. Charles Simonyi. He worked for the Xerox Palo Alto Research Center (XPARC) before joining
Microsoft. He came up with short prefix mnemonics that allowed programmers to easily identify the type
of information a variable might contain. Since Dr. Simonyi is Hungarian, and the prefixes make the
names look a little foreign, the name Hungarian Notation stuck. Because the original notation was used
in C/C++ development, the notation for Visual Basic .NET is termed Modified. Table 1.1 shows some of
the commonly used prefixes that you shall be using in this book.
Hungarian Notation can be a real time-saver when looking at code someone else wrote, or at code that
you have written months past. However, by far the most important thing is to be consistent in your
naming. When you start coding, pick a convention for your naming. It is recommended that you use the
de facto standard Modified-Hungarian for Visual Basic .NET, but it is not required. Once you pick a
convention, stick to it. When modifying someone else’s code, use theirs. A standard naming convention
followed throughout a project will save countless hours when the application is maintained. Now let’s
get back to the application. It’s now time to write some actual code.
The Code Editor
Now that you have the HelloUser form defined, you have to add some code to actually make it do
something interesting. You have already seen how easy it is to add controls to a form. Providing the
27