ramblings on PHP, SQL, the web, politics, ultimate frisbee and what else is on in my life
back

userland naming guide

I have been asking for this for a long time and the text has been sitting in my wiki for almost as long, but I was waiting for an official blessing from internals. In the end I just went ahead and wrote up some patches for phpdoc, Sean and Nuno were kind enough to review and commit them. So now we finally have some guidelines on how users should name their identifiers to be fairly future proof. This should hopefully help reduce the amount of pain people suffer when PHP adds new features like a class for Date or File handling. Although the two mentioned examples have settled on using DateTime and FileObject to get around the issue at least partially.

The guide itself is unfortunately spread over 3 pages, which does not seem to make sense since there is really not that much content there yet. Then again the guide may get expanded in the future. Anyways I recommend that every serious PHP programmer have a look at the guide. If there are any issues please let me (or the PHPDoc team) know. Otherwise make sure you adapt your internal CS to match this guide.

Comments



Re: userland naming guide

On those "tips". How about a public database of prefixes that are in use? Think /etc/services for prefixes, so new code development teams could check easily if a pre-(or post-)fix already taken.

Might come in handy, also, might be a waste of time.

Just my initial thought on reading the docs. Good work tough!

Best,
Jan
--

Re: userland naming guide

I guess that is not something php.net is going to get into. Well maybe the PEAR channel listing could get expanded to cover this or maybe PEARadise.

Re: userland naming guide

Namespaces, namespaces, namespaces.

Adding namespace support is the right thing to do. It won't fix older code, but you've got to start some where.

Re: userland naming guide

This is one of the best things to happen in a long time.

@Lukas: Maybe you should have linked the "interesting" thread on the PHP mailinglist that went along with the date class. ;) Which illustrates how big of a problem this is or can be.

Before you can post a comment please solve the following captcha.
your name