Re: How to name variables in a program?



Arthur J. O'Dwyer wrote:
> On Sun, 29 May 2005, Phlip wrote:
> > namespace db {
> > ...
> > class pop3 {
> > ...
> > msg->getHdr();
> > }
> > }
> >
> > Now we need to type db and pop3 less often, so we can safely make them
> > longer. Similarily, the line with msg->getHdr() is now shorter, so we have
> > room to make it longer:
> >
> > namespace eMailDatabase {
> > ...
> > class PostOfficeProtocolThree {
> > ...
> > pMessage->getHeader();
> > }
> > }
>
> I assume you were just casting about for a way to make Paul's 'pop3'
> longer, but surely you know that 'PostOfficeProtocolThree' is a horrible
> name for a class! Rather than obfuscating the fact that the class has
> something to do with POP3 (not "Post Office Protocol Three"), it would
> be better to use a /more/ descriptive name, preferably a noun such as
> 'POP3Interface' or 'POP3MessageInfo'.

Indeed, he just missed my comment about the tendency towards acronyms
and shorthands that is natural and pervasive is general discourse. If
you want to go *that* verbal, put it in a comment. And go ahead and
mention the RFC for it as well. "Post Office Protocol Three" is not
something you'll ever hear in normal conversation outside the
discussion of the RFC itself. The right name *is* POP3; everyone knows
what you mean (even non-programmers might know, if they had to set up
their own mailclient.) Using the full name "database" instead of db,
is just the same thing to a lesser degree.

He also missed the point where I showed his own hyppocracy in using
"HN" to mean hungarian notation. Acronyms are useful, and don't need
to contribute to obfuscation.

> [Paul wrote:]
> >> The other advantage of my scheme is that when you ASCII sort the
> >> symbols, they make some sort of sense and look fairly organized
> >> anyways.
>
> ;-) Wouldn't they look even more organized if you named them
> alphabetically starting at 'aa' and going up toward 'zz'? (If you plan
> to have more than 676 object classes in your program, the natural
> extension to 'aaa'--'zzz' applies.) Point is, /looking/ organized
> and actually /being/ organized are two different things.

Ok actually sorting the names is not the highest concern. But seeing a
list of such functions next to each other is a very common thing.
Knowing that a certain group of them happen to be from the same module
is a useful thing, and a very natural thing if they all have the same
prefix -- this property just happens to coincide with good sorting
properties with other useful naming restrictions.

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

.



Relevant Pages

  • Re: mail verschicken aus c#
    ... 'System.Web.Mail' Namespace ... Support Policy for Microsoft Exchange APIs with .NET Framework Applications ... Using POP3 with C# to download and parse your mail. ... The Indy Project ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: how to send attachement with pop3
    ... You can use System.Web.Mail namespace it's is a wrapper on CDOSYS. ... Includes POP3 and STMP clients. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Is there a POP3 Mail Component?
    ... If you're looking for a good 3rd party POP3 control, ... > Hi Matt, ... > Based on my understanding, you want to get a POP3 component to connect to ... > use System.Net namespace to write one yourself. ...
    (microsoft.public.dotnet.languages.csharp)