Computing (FOLDOC) dictionary
Jump to user comments
language, convention A linguistic convention requiring one
or more letters to be added to the start of
variable names
programming environments, such as Microsoft
C,
C++ and
Microsoft for many years. He disliked the way that names in
C programs gave no clue as to the type, leading to frequent
programmer errors.
According to legend, fellow programmers at Microsoft, on
seeing the convoluted, vowel-less variable names produced by
his scheme, said, "This might as well be in Greek - or even
Hungarian!". They made up the name "Hungarian notation"
Hungarian Notation is not really necessary when using a modern
programmer if a variable of one type is used as if it were
going to be instances of
classes and so begin with "obj".
In addition, variable names are essentially only
comments,
and thus are just as susceptible to becoming out-of-date and
incorrect as any other comment. For example, if a
signedname, and every use of it, should be changed to reflect its
new type.
A variable's name should describe the values it holds. Type
and scope are aspects of this, but Hungarian Notation
overemphasises their importance by allocating so much of the
start of the name to them. Furthermore, type and scope
information can be found from the variable's declaration.
Ironically, this is particularly easy in the development
environments in which Hungarian Notation is typically used.
(2003-09-11)