Hungarian notation

Updated: 04/26/2017 by Computer Hope

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 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" string (a string that needs to be sanitized before it is used) 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