From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,f292779560fb8442 X-Google-Attributes: gid109fba,public X-Google-Thread: fac41,af40e09e753872c X-Google-Attributes: gidfac41,public X-Google-Thread: 1014db,30e368bdb3310fe5 X-Google-Attributes: gid1014db,public X-Google-Thread: 1008e3,30e368bdb3310fe5 X-Google-Attributes: gid1008e3,public X-Google-Thread: f8c65,30e368bdb3310fe5 X-Google-Attributes: gidf8c65,public X-Google-Thread: 103376,30e368bdb3310fe5 X-Google-Attributes: gid103376,public X-Google-Thread: 10db24,30e368bdb3310fe5 X-Google-Attributes: gid10db24,public From: rsrodger@wam.umd.edu (Bob Rodgers) Subject: Re: Hungarian notation Date: 1996/05/21 Message-ID: <4nsgct$c3l@cville-srv.wam.umd.edu>#1/1 X-Deja-AN: 155923574 references: <31999F43.41C67EA6@scn.de> <319D2278.3F9A@netonecom.net> <4nr50r$jo2@ringer.cs.utsa.edu> organization: University of Maryland College Park newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.edu,comp.lang.eiffel Date: 1996-05-21T00:00:00+00:00 List-Id: nreitzel@lonestar.jpl.utsa.edu (Norman L. Reitzel ) wrote: >>> Hungarian Notation is an excellent concept, but I am sure that it will be >>> appreciated only by the programmers who have to work with serious code and [...] >>B.S!! It is a b-a-a-a-a-a-d idea. It is an idiotic coding standard. In "Programming Pearls," [...] >What's worse, Arne, somebody will change the type, say from szShortSTring >to pszReallyLongString, find that it's referenced a zillion times, and >"fix" it by changing the name BACK, and then changing some (but not all) That's not a good example (because it's semantically harmless, and because search & replace will handle it quite quickly, even on multiple files). On the other hand, suppose one decided to change from a signed to unsigned float? Or from an int to a float? Hungarian *forces* the programmer to verify that things are right, at least, right on a superficial level. Good programmers don't need a naming scheme to force them to write good code. Unfortunately, most programmers (including those paid to program) aren't good programmers. For most programmers, warnings (conversion, etc.) aren't sufficient -- too many of them ignore or (worse) disable them. This is almost routine. I've seen people work this way: the first thing they do is disable conversion warnings, signed/unsigned warnings, etc. These are not kids with compilers, but people being paid to develop apps that that will need to be maintained for the next ten or more years. What it comes down to is, hungarian naming is an excellent idea for companies that hire programmers of low to middle ability. It cuts down on their errors in development and long-term maintenance costs. That "good" programmers uses warning level 4 and seek to compile with zero errors or as close to zero as possible is a given. That the majority of programmers do neither is, on the other hand, quite obvious. We need only look at the quality of software than sits on store shelves. Run Netscape lately? Some of those crashes, of which there are way, way too many, look oddly like someone writing to an invalid pointer, something that should have been caught a long time ago or never present in the first place. If you are a company hiring mid-low skilled programmers (and lets face it: we *all* start off low and mid-skilled,, it is only experience & practice that helps us improve), hungarian provides a solution to at least part of several problems: code maint. (forcing developers to check as they develop, and not "assume" that changes work, especially on multiperson projects where idiots routinely integrate their code changes without even checking to see if they compile), code readability (inexperienced programmers often "shuffle and add" instead of scrapping bad code and rewriting), and so on. Hungarian isn't "bad" -- it's just not *good* for some programmers. >it does it is an error waiting to happen. The rude concept of >"self-documenting" code belongs in an ivory tower with those who teach, >not in the trenches with those of us who DO. Well, we agree here. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - http://www.wam.umd.edu/~rsrodger homepage & gallery http://www.wam.umd.edu/~rsrodger/project.htm rsrodger@wam.umd.edu