Re: How to name variables in a program?



Alf P. Steinbach wrote:
> * Paul Hsieh:
> >
> > int dbPop3MsgHdrGet (struct pop3Db * db, struct mimeMsgHdr * msg);
>
> It's difficult to say whether this is irony or just misguided.
>
> Presumably it's for C?

Yes it is, sorry, I didn't say that up front.

> Have you tried to _pronounce_ those, uh, "names"?

What's the problem?

"dee bee pop three message header get"
"pop three dee bee"
"mime message header"

If you think these are long names, remember that the long ones are
mainly used for external interfaces. In a good design, external
interfaces tend to be as minimal as possible anyway.

> Switch to C++ or D, Paul.
>
> Or any language with namespace support.

Of course, rather than prefixing module names (a C-like thing) you can
just use namepaces in C++. (And I'll consider D, when there is a
somewhat-open standards committee or at least two vendors making the
compilers for it.)

--
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/

.