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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,af40e09e753872c X-Google-Attributes: gidfac41,public X-Google-Thread: 109fba,f292779560fb8442 X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,30e368bdb3310fe5 X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,30e368bdb3310fe5 X-Google-Attributes: gid1014db,public X-Google-Thread: f8c65,30e368bdb3310fe5 X-Google-Attributes: gidf8c65,public X-Google-Thread: 10db24,30e368bdb3310fe5 X-Google-Attributes: gid10db24,public X-Google-Thread: 1008e3,30e368bdb3310fe5 X-Google-Attributes: gid1008e3,public From: seebs@solutions.solon.com (Peter Seebach) Subject: Re: Hungarian notation Date: 1996/05/14 Message-ID: <4na9r2$qin@solutions.solon.com>#1/1 X-Deja-AN: 154772164 references: <4adem2$b5s@mercury.IntNet.net> <4ahka7$o9m@inrou.erno.de> <4n6off$6e2@mikasa.iol.it> <3198F30F.2A2@zurich.ibm.com> organization: Usenet Fact Police (Undercover) reply-to: seebs@solon.com newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.edu,comp.lang.eiffel Date: 1996-05-14T00:00:00+00:00 List-Id: In article <3198F30F.2A2@zurich.ibm.com>, Keith Whittingham wrote: >Roger Merritt wrote: >> The idea is that you include information in the name of the variable >> to help you remember the type. So a pointer to a char might be named >> cpCurrent. >> Same thing applies to function names to help you remember the type >> returned. >And is absolutely horrible! It serves little purpose especially in the world >of C++ as we can invent our own data types and attempting to extend the >convention to include our newly defined types makes the code unreadable. (Please note that this is in several groups other than clc++.) Please don't blame Hungarian for that. I lack the rigor and devotion necessary to even design, let alone use, a Hungarian style naming convention, but I feel compelled to defend it. It has *nothing* to do with this idiotic practice of prefixing things with their low-level types. The intent was that *for any specific project* you would devise a naming convention which tagged things with their high-level type. For instance, if you used size_t a lot, you might use the prefix s, so you would have sFoo for a size_t named Foo. You would *not not not* encode this as ui or ul. The original Hungarian notation person has apparently written diatribes about M$'s systematic destruction and violation of the original idea; I'd love to see copies of this, so I could just mail them to people who keep quoting and using the utterly evil and destructive form. >In addition it makes it difficult to change a int to an unsigned int or to >a long without updating every occurence of the variable name in the code. Only when done by the terminally naive. If you use prefixes relating to abstract types, it can be a helpful notational cue, without the @#*@# idiocies of... Well, nevermind, I've ranted enough. -s -- Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach. Does anyone read these things? I doubt it, but I've never been sure. Unsolicited email is not welcome, and will be billed for at consulting rates. The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html