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: 10db24,30e368bdb3310fe5 X-Google-Attributes: gid10db24,public X-Google-Thread: f8c65,30e368bdb3310fe5 X-Google-Attributes: gidf8c65,public X-Google-Thread: 1014db,30e368bdb3310fe5 X-Google-Attributes: gid1014db,public X-Google-Thread: fac41,af40e09e753872c X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,30e368bdb3310fe5 X-Google-Attributes: gid103376,public X-Google-Thread: 1008e3,30e368bdb3310fe5 X-Google-Attributes: gid1008e3,public From: ok@goanna.cs.rmit.EDU.AU (Richard A. O'Keefe) Subject: Re: Hungarian notation Date: 1996/05/23 Message-ID: <4o19k3$o4b@goanna.cs.rmit.EDU.AU>#1/1 X-Deja-AN: 156274719 references: <4adem2$b5s@mercury.IntNet.net> <4n6off$6e2@mikasa.iol.it> <3198F30F.2A2@zurich.ibm.com> <4nsg3f$liu@solutions.solon.com> <31a3b322.442404233@sqarc> organization: Comp Sci, RMIT, Melbourne, Australia newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.edu,comp.lang.eiffel nntp-posting-user: ok Date: 1996-05-23T00:00:00+00:00 List-Id: willer@carolian.com (Steve Willer) writes: >Besides, let's say for the sake of argument that you're not using HN: > myZ->Something = 3; >First of all, I'll never remember that myZ is a pointer and Something is >an int. I can't rely on my memory and I certainly can't rely on some >other maintainer's ability to memorize my code. But you _can_ rely on the compiler... >But that aside, what if you do need to change it to a function? Well, that's a problem with C++, not a benefit of (non-H)N. >How can >you possibly avoid editing the calling code (unless you used that >#define hack, which isn't even an option)? At the very minimum, you'd >have to change it to > myZ->Something() = 3; >or > myZ->Something(3); How many people remember what a "selector" is in Alphard? Can anyone explain to me why Ada doesn't have them (function().all isn't quite the same thing; selectors are usefully restricted). In Lisp, it's simply a matter of changing (setf (zed-something my-zed) 3) to (setf (zed-something my-zed) 3) No, there is no typo. >Either way, you have to change existing code, so I don't see the >disadvantages of having HN in it already. I wonder why Lisp programmers have never felt the need for HN? >???? You're kidding, right? "FILE" is the struct used by the stdio >functions. How can any function get a descriptor number from an array of >chars? If you don't know the answer, you don't yet know C. >That issue aside...I would use the prefix "pf", as in "pointer to file". >So my declaration would perhaps be: > FILE *pfFoo; >Seems pretty clear to me. And how gave you the exclusive rights to "f"? What about the other poor schmuck in your project who needs pointers to floats? The rather interesting thing here is that the C stdio interface has a design flaw: the abstract data type C programmers really need to deal with is (FILE*) not (FILE). The only reason that it's useful to know if there's a pointer in there is so that you can compare it with NULL. typedef FILE* Stdio_Stream; ... Stdio_Stream log_stream; is a bit clearer than "pfFoo". -- Fifty years of programming language research, and we end up with C++ ??? Richard A. O'Keefe; http://www.cs.rmit.edu.au/~ok; RMIT Comp.Sci.