naming protocol

Miscellaneous Forums/General Discussion/naming protocol

> Do you use all that Hungarian variable stuff?

Used to, but spelling out what type a variable is in the name got agravating after changing the types of a couple variables way back when (it's easier to do now with auto variable renaming in most IDE's, but still a chore)

All I have left of the hungarian stuff was putting a prefix in front of each variable - and even that I've gone with my own system of the following.

p_ for Parameters (A_ if you prefer argument)
l_ for local variables.
g_ for global variables
m_ for module level variables (or class level if in a class based system like java)

The main reason I stuck to that was it made life in VB6 much more reasonable, renaming is easy if you stick to using the underscores only for the prefix, no getting the wrong variable in a global search and replace, it allows easily checking the scope of a variable by it's name, and it allows system reservred words for variable names (date is no good for a variable while l_date and p_date are fine in just about everything)