n. An area of memory used for dynamic memory allocation. Calls to malloc() and free() and the C++ operators new and delete result in run-time manipulation of the heap. In Java, there is a heap and a new keyword, but no way to manually free the space. A garbage collector does that automatically.

high-level language

n. A language, such as C, C++, Ada, or Java, that is processor independent. Abbreviated HLL. When programming in a high-level language, it is possible to concentrate on algorithms and applications without worrying about the details of a particular processor.

HISTORY: The first high-level language (Fortran), when invented in the 1950s, was criticized as generating slow and bloated machine code. Despite a half century of progress in language and compiler design since then, many still wage code bloat versus programmer efficiency flame wars.


n. A general-purpose computer that communicates with the target via a serial port or network connection.

host target communications

The host is used to develop and debug firmware for the target

Hungarian notation

n. A variable naming convention that encodes a variable's type as a prefix to its name. For example, an integer might be named iVariableName, with the leading i denoting the variable's type. Hungarian notation is promoted as a readability aid, which helps the programmer avoid the headache of digging through typedefs and include files to determine a variable's type.

Hungarian notation is essentially a commenting technique. Comments often lie, though, when they become outdated—a huge source of problems with the notation. Change the type of a variable (say, when porting the code from a 16- to a 32-bit processor), and you have to search out and change the name of every use of that variable. That rarely happens, of course, as in wParam in Microsoft's Win32 APIs: the type changed from a 16-bit value (w stands for word) to a 32-bit value (which should have been dwParam).

In practice, the prefix idea is extremely valuable for marking three common variable types in C programs: globals, pointers, and booleans. These three types are also unlikely to change as the program evolves.

Global variables are dangerous, particularly when they are used in multitasking systems. So marking them with a preceding g, though not truly Hungarian in its style, is helpful for identifying possible critical sections.

By preceding a pointer variable with p, dereferencing the right number of times becomes easy. Whereas pFoo refers to the pointer, *pFoo and pFoo-> clearly refer to the actual object. Likewise, if you have a pointer to a pointer, label it with a pp.

Boolean variables labeled with a preceding b are easy to spot in a code listing and make their use in tests easy to get right. You would never write x = bReady + 1;, for example. Although if (!bReady) { ... } makes perfect sense.

HISTORY: Invented by Charles Simonyi of Microsoft. The programmers there looked at the convoluted, vowel-less variable names produced by his scheme and, like everyone else who has come into contact with them since, must have said something like "This might as well be in Greek—or even Hungarian!" They almost certainly had in mind, as well, another kind of mathematical system called Polish notation. They put the two together and made up the name "Hungarian notation."

FURTHER READING: See http://web.mst.edu/~cpp/common/hungarian.html for a list of common prefixes.