University of California, Berkeley
EECS Dept, CS Division
Jordan Smith SLIDE: Scene Language for
Interactive Dynamic Environments
Prof. Carlo H. Séquin

Home Goals Publications People Gallery Assignments Distributions

SLIDE Hungarian Notation

What is Hungarian Notation?

Hungarian Notation is a naming convention, invented by Charles Simonyi, which encodes things about a variable's type (and perhaps its intended use) in its name. The SLIDE code uses a variation of this Hungarian for naming all of its variables and enumerated types. Variable names might look confusing at first, but once you learn the naming convention you find that it aids in understanding new code without having to do a lot of look ups into the header files.

C++ Naming Conventions

A standard C++ member variable might have a name like m_uiVertices. This should read: member variable (m_), unsigned (u) integer (i) number of vertices (Vertices). The following table gives a list of the common prefixes used in the SLIDE source code:

Prefix Meaning
C C++ class variable
m_ Member variable of a class
g Global variable
s Static variable
p Pointer: there may be N of these in which case it will take N dereferences of the variable (a combination of *'s on the left or [index]'s on the right) to get to the actual data value.
u Unsigned
c Character if used on the far right, or constant type if used on the far left
b Boolean
i Integer
f Floating Point
d Double
v Void
fp File Pointer
e Enumerate value variable
?t Used in the front of Enumerated value constants means whatever type
pt Point class object
v Vector class object
m Matrix class object
mGa_b Column Vector Matrix: Pa = mGa_b * Pb

SLIDE .slf Naming Conventions

Because the Hungarian Notation has been such a benefit in C++ coding, we also use it regularly in SLIDE .slf geometry description files. We use a similar set of prefixes for the identifier names of different SLIDE geometry objects. The following table gives a list of the common prefixes used in the SLIDE .slf files:

Prefix Meaning
s SLIDE Surface
p SLIDE Point
f SLIDE Face
o SLIDE Object
g SLIDE Group
i SLIDE Instance
c SLIDE Camera
l SLIDE Light
vp SLIDE Viewport
win SLIDE Window



This page was originally built by Jordan Smith.

Last modified: Friday, 12-Feb-1999 12:10:25 PST