Hey,

I think we should come to closure on this discussion because it's becoming hard to catch up with.
I'd like to finalize this issue for PHP (the C part) so that we can release Beta 3. I think what PEAR does is really up to the PEAR dev team (although I think it would be nice for them to be consistent with PHP itself).
The facts are the following:
a) Existing PHP functions use underscores.
b) Some external object models such as Java use StudlyCaps.


The immediate decision we have to make is if PHP's OOP functionality (class names and method names) use underscores or studly caps.
I think for (b) (interfacing with external object models) the answer is obvious. Do what you need to do to expose the external object model, and thus use StudlyCaps where applicable. That's kind of obvious IMO. If the external object model has underscores then use that.


However, I think what we do with PHP's object model is not that obvious. Although I'm quite indifferent to these when I program (I usually use the most popular method with the language I'm using) I think there are two advantages for using underscores:
a) functions already use them thus we are consistent across the board (something we historically don't excel in).
b) StudlyCaps doesn't know how to deal with one character words such as IAmAndi. which would be something like i_am_andi in underscores. You often find yourself having to do two capitol letters one after another and it ruins the whole thing. The same thing happens with acronyms, for example, PHPObject (no differentiation between PHP and Object).


I think that even if some OOP developers prefer the studly caps, using underscores might even have an advantage of differentiating between PHP methods and the user's methods.
Let's not turn this into a religious war. I think everyone here understands the pros/cons. Let's try and reach a decision quickly and make sure we adopt it, because indecision is worse than making the wrong decision :)


I apologize for the long letter. Please don't copy me :)
Andi

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to