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 Name2you 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
Modied Hungarian notation. The notion of prexing 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 prex mnemonics that allowed programmers to easily identify the type
of information a variable might contain. Since Dr. Simonyi is Hungarian, and the prexes 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 Modied. Table 1.1 shows some of
the commonly used prexes 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 Modied-Hungarian for Visual Basic .NET, but it is not required. Once you pick a
convention, stick to it. When modifying someone elses code, use theirs. A standard naming convention
followed throughout a project will save countless hours when the application is maintained. Now lets
get back to the application. Its now time to write some actual code.
The Code Editor
Now that you have the HelloUser form dened, 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