S
Sebastian Mares
Hello!
As long-time Visual Basic 5 and 6 developer, I am quite familiar with
the Hungarian Notation and used it in most of my programs. Now that I
finally got into the .NET world and learned VB .NET and C# (and am
currently learning C++), I decided to give up HN as recommended by
Microsoft. However, I am facing one problem: Microsoft recommends to use
names that are semantically relevant. Therefore, if you have a text
field for example where the user has to enter his first name, you would
name that text box "FirstName" instead of "txtFirstName" or "Textbox1"
or "Name1" or whatever. But what do you do when you have a menu item and
a toolbar button that both do the same thing? Semantically, there's no
difference between the two elements, but unlike in "legacy" Visual Basic
where you could give two controls the same name in order to have a
control array, you have to give the two controls different names. With
HN, you could name one control "mnuOpen" (mnu = menu) and the other one
"tbOpen" (tb = tool button). Does anyone have a solution for this (other
than using Open1 and Open2 as control names)?
Regards,
Sebastian
As long-time Visual Basic 5 and 6 developer, I am quite familiar with
the Hungarian Notation and used it in most of my programs. Now that I
finally got into the .NET world and learned VB .NET and C# (and am
currently learning C++), I decided to give up HN as recommended by
Microsoft. However, I am facing one problem: Microsoft recommends to use
names that are semantically relevant. Therefore, if you have a text
field for example where the user has to enter his first name, you would
name that text box "FirstName" instead of "txtFirstName" or "Textbox1"
or "Name1" or whatever. But what do you do when you have a menu item and
a toolbar button that both do the same thing? Semantically, there's no
difference between the two elements, but unlike in "legacy" Visual Basic
where you could give two controls the same name in order to have a
control array, you have to give the two controls different names. With
HN, you could name one control "mnuOpen" (mnu = menu) and the other one
"tbOpen" (tb = tool button). Does anyone have a solution for this (other
than using Open1 and Open2 as control names)?
Regards,
Sebastian