Hungarian notation

Updated: 10/07/2019 by Computer Hope
Hungarian notation

Hungarian notation is a naming convention in computer programming that indicates either the type of object or the way it should be used. It was originally proposed by Charles Simonyi, a programmer at Xerox PARC (Palo Alto Research Center) in the early 1980s. There are two variations of Hungarian notation: Systems and Apps. They both involve using a special prefix as part of the name to indicate an object's nature.

Systems Hungarian notation

In Systems Hungarian notation, the prefix represents the actual data type of the object. For instance, if the object named Greeting were a zero-terminated string, its Systems Hungarian name might be szGreeting. Or, if the object YesOrNo were a boolean variable, its Systems Hungarian name would be bYesOrNo.

Apps Hungarian notation

In Apps Hungarian notation, the prefix represents the logical data type, which gives an indication of the object's purpose. For instance, an "unsafe" (unsanitized) string might have the prefix us, and a variable used for counting might be prefixed with n.

Hungarian notation prefixes

The prefix used is up to the programmer, but standard prefixes include:

Programming terms