[AccessD] Naming Conventions

Arthur Fuller artful at rogers.com
Wed Aug 4 11:40:46 CDT 2004


After two decades of propounding standard Hungarian notation, I am now
dead set against it, for two reasons:

A) You have to read past the prefix to find out what anything relates
to. IOW, you increase noise at the expense of signal.
B) All objects named thus sort poorly. How does it help you if every cbo
is prefixed "cbo"?

For the past year or so I have used what I call the "object-action"
naming scheme. It uses Hungarian notation but as suffix not prefix. This
preserves the sort order in a meaningful way. A couple of examples:

CustomerInsert_ap - suffix means application procedure (as opposed to
system procedure)
CustomerSelectByName_fnt - user-defined function that returns a table of
customerIDs and names sorted by name (SQL 2000+ only)
CustomerFilter_cbo - combo box that filters the form by selected
customer (i.e. show only the orders placed by selected customer)

Perhaps the main reason that I have moved to this convention is the ease
of teaching it to a new hire, and letting her find her way around the
database quickly. "Look for the object of interest, followed by the
action of interest, and know what you're dealing with by the suffix."

In Access 2002+, this convention is especially profitable, because a
single "Queries" tab houses sprocs, UDFs and views. Prefixing them all
with standard Hungarian prefixes muddies the water, IMO. My convention
lets you type "C" and immediately go to all the "Customer" related
stuff. Then you can quickly deduce what's available for re-use, and what
sort of object it is.

Given the overwhelming devotion to standard Hungarian notation, I expect
this message to cause lots of flames and rebuttals. That's why we're
here, after all :)

Arthur




More information about the AccessD mailing list