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: f8c65,30e368bdb3310fe5 X-Google-Attributes: gidf8c65,public X-Google-Thread: 1014db,30e368bdb3310fe5 X-Google-Attributes: gid1014db,public X-Google-Thread: 109fba,f292779560fb8442 X-Google-Attributes: gid109fba,public X-Google-Thread: 1008e3,30e368bdb3310fe5 X-Google-Attributes: gid1008e3,public X-Google-Thread: 103376,30e368bdb3310fe5 X-Google-Attributes: gid103376,public X-Google-Thread: 10db24,30e368bdb3310fe5 X-Google-Attributes: gid10db24,public From: seebs@solutions.solon.com (Peter Seebach) Subject: Re: Hungarian notation Date: 1996/05/23 Message-ID: <4o22c2$ivt@solutions.solon.com>#1/1 X-Deja-AN: 156331575 references: <4adem2$b5s@mercury.IntNet.net> <4nsg3f$liu@solutions.solon.com> <31a3b322.442404233@sqarc> 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-23T00:00:00+00:00 List-Id: In article <31a3b322.442404233@sqarc>, Steve Willer wrote: >The reason this doesn't bother me at all is that I don't use data >members very often. At least with C++, my language, you're much better >off to design your classes based on actions and queries, rather than >direct data-exchange. The consequence of this is that member-variables >aren't generally public. This is good design in C, also, although the syntax is spelled differently. >>... Hmm. Maybe it's "pst". Nope, FILE may not be a struct. Maybe it's >>"pch". Nope, file may not be a char, even though FILE * is often really >>a pointer to char. >???? 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? Perhaps it points to a character which holds the value of the descriptor that implements that file. Perhaps the character pointed to is the index into a hidden array of other things. It's a struct *in some implementations*. No legitimate code can ever tell, nor can it make any use of the internals or contents of the struct if it is one. It is merely an opaque abstract type. >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. Yes. You have seen through the false type-safety of encoding low level types, and found the true path of encoding the meaning, not the implementation. -s -- Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach. Unix/C Wizard - send mail for help, or send money for consulting! 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