Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!udel!princeton!phoenix!pucc!EGNILGES From: EGNILGES@pucc.Princeton.EDU (Ed Nilges) Newsgroups: comp.software-eng Subject: Re: Experiences with Hungarian Nami Message-ID: <9513@pucc.Princeton.EDU> Date: 2 Sep 89 23:23:06 GMT References: <974@swdev.waterloo.ncr.com> <138300002@cdp> Reply-To: EGNILGES@pucc.Princeton.EDU Organization: Princeton University, NJ Lines: 43 Disclaimer: Author bears full responsibility for contents of this article I have been following the discussion of Hungarian notation with some interest. Actually, the idea is not new: I read an IBM standards textbook which enjoined something of the same practice, reflecting data types in data names, on Assembler programmers. I much prefer a notation which prefixes each variable by a Dewey Decimal code reflecting the position of the variable's owner in the program...if routine "aa" declares and uses a variable length, then the name of the variable becomes aa_length. Where the overall architecture of the program is a hierarchy (frequently the case in business programming, less often the case in scientific or systems programming), then the Dewey Decimal code accurately reflects the variable's owner, and the owner's position in the hierarchy: a_mainline owns a_i, a_j, and calls aa_read_parms, which owns aa_parmcount ab_read_next, which calls aba_check_next . . . Where routines crop up that violate the hierarchy, they get prefixes from the end of the alphabet. Again, such routines arise more frequently in scientific, systems software, and event-driven routines...note that the above is probably a simple batch application. However, in nontraditional code, there are frequently mini-hierarchies, miniature city-states of code that are called in a complicated network, but have themselves a hierarchical structure. Hungarian notation is a threat to effective maintenance because incompetent (or simply under-informed) maintainers may make changes that invalidate the information contained in Hungarian notation. Of course, the same charge applies to Dewey Decimal notation or indeed any friendly attempt to document one's code. My (quite unscientific) personal observation has been that the sort of design changes that invalidate the architectural information provided by Dewey Decimal notation are much less frequent than the sort of implementation changes that invalidate Hungarian notation. ************************************************************************ "Oh, I could prophesy: but thou art dust, Harry, and food for..." - Henry IV, Part II