Re: cvs: php4 /pear Mail.php /pear/Mail rfc822.php
| From: | Chuck Hagenbuch | Date: | Thu, 04 Jan 2001 15:13:53 +0000 |
| Subject: | Re: cvs: php4 /pear Mail.php /pear/Mail rfc822.php | ||
| References: | 1 2 | Groups: | php.pear |
| Request: | Send a blank email to php-pear+get-770@lists.php.net to get a copy of this message | ||
Quoting "Stig S. Bakken" <ssb@fast.no>:
> Just a nit: Why the lowercase "rfc" when everything else is StUdLyCaPs?
Because "Rfc" looked ugly to me.
Seriously, let's adopt a standard. Right now we have the studlyCaps standard:
File_Search
Date_Calc
etc... then we have DB:
DB_mysql
DB_common
Mail_smtp
etc...
What do we want? Renaming the DB classes would be a pain, but if we're going to
do it for consistency, let's do it now. Do we go with first letter of each word
capitalized, with an underscore wherever a directory (indicator of hierarchy)
is?
Spelled out, that would mean:
DB_Mysql
Mail_Smtp
Mail_Rfc822
and a class for searching quickly within files would be:
File_FastSearch
(studlycaps, but underscores only where the class hierarchy goes down a
level) ... with the corresponding filename File/FastSearch.php
Speaking of filenames, that's another issue. Right now we have the standard
that classname matches filename, with the abovementioned convention of using
underscore for directories. This is good, because it lets us determine class
names from filenames and filenames from class names. It's bad because it means
that class names get extremely long if the hierarchy gets moderately deep
(imagine java without import - that's essentially the situation we have).
On the other hand, since we don't have import or any other way of representing
namespaces or hierarchy right now, I think it's a good convention to have -
otherwise Net/SMTP and Mail/SMTP would be clashing already, and it just gets
worse from there.
Oh, and that last example brings up my last point: acronyms. Do we keep them
capitalized:
Mail_SMTP
Mail_RFC822
or only capitalize the first letter:
Mail_Smtp
Mail_Rfc822
? I suppose I could get used to either.
Comment, and I'll write up (and then enforce in the repository) what we decide.
-chuck
--
Charles Hagenbuch, <chuck@horde.org>
"If you can't stand the heat, get out of the chicken!" - Baby Blues