G.3. The Fundamentals of the Hungarian Convention

The Hungarian convention has a very straightforward design. It dictates that a name may contain up to five parts, and that they are combined in the order of prefix(es), tag, BaseName, qualifier, and suffix defined below. Although all parts are not required, nearly every name will contain a tag and a BaseName.

  • A prefix precedes a tag to provide clarification. It can describe one or more important properties with one or two lowercase characters.

  • A tag is, by some, considered to be the critical, non-optional element. A tag should be unique and easily differentiated from similarly named tags. A tag is typically three (occasionally four) lowercase characters that identify what the object is, for example, a table, form, or text box. The tag is usually a mnemonic abbreviation, such as "tbl," "frm," and "txt" or the first letter of each word from multiword items. Exceptions are often due to the tag already being assigned for a different purpose, adopting a tag from another program and, of course, it isn't always easy to create an intuitive three-letter abbreviation.

  • The BaseName is a descriptive name that defines the particular object. This could be the layman's term used to concisely identify the subject. Use proper case and be brief but clear.

  • A qualifier is an extension that indicates how the object is being used. Qualifiers should be proper case and as short as practical, without sacrificing comprehension. For example, the qualifier Avg ...

Get Access 2003 VBA Programmer's Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.