Hungarian notation

Hungarian notation is an identifier naming convention in computer programming in which the name of a variable or function indicates its intention or kind, or in some dialects, its type. The original Hungarian notation uses only intention or kind in its naming convention and is sometimes called Apps Hungarian as it became popular in the Microsoft Apps division in the development of Microsoft Office applications. When the Microsoft Windows division adopted the naming convention, they based it on the actual data type, and this convention became widely spread through the Windows API; this is sometimes called Systems Hungarian notation.

Simonyi: ...BCPL [had] a single type which was a 16-bit word... not that it matters.

Booch: Unless you continue the Hungarian notation.

Simonyi: Absolutely... we went over to the typed languages too later ... But ... we would look at one name and I would tell you exactly a lot about that...[1]

Hungarian notation was designed to be language-independent, and found its first major use with the BCPL programming language. Because BCPL has no data types other than the machine word, nothing in the language itself helps a programmer remember variables' types. Hungarian notation aims to remedy this by providing the programmer with explicit knowledge of each variable's data type.

In Hungarian notation, a variable name starts with a group of lower-case letters which are mnemonics for the type or purpose of that variable, followed by whatever name the programmer has chosen; this last part is sometimes distinguished as the given name. The first character of the given name can be capitalized to separate it from the type indicators (see also CamelCase). Otherwise the case of this character denotes scope.

  1. ^ "Oral History of Charles Simonyi" (PDF). Archive.computerhistory.org\accessdate=5 August 2018. Archived (PDF) from the original on 2015-09-10.