Re: Studlycaps and MySQLi

From: Date: Fri, 26 Mar 2004 14:53:28 +0000
Subject: Re: Studlycaps and MySQLi
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-8775@lists.php.net to get a copy of this message
On Mar 26, 2004, at 9:38 AM, Ilia Alshanetsky wrote:
On March 26, 2004 09:35 am, you wrote:
So one would inherit from/extend a native class and then use studlyCaps and call underscore style methods from parent class. Can you imagine how ugly would this look?
It may look ugly, but without a doubt it would be very clear which code is 'user' and which is 'PHP'. Ugliness in general makes code difficult to read, in this case (IMO) it actually makes the situation a little clearer.
As Edin and Lukas have both pointed out, one of the major precepts of OO programming is that you can (and often do) overload methods in your parent. Adopting two different styles really doesn't work if you ever want to use any of the in-core classes, as it will force your own code to adopt both notions. In fact, the argument that people use StudlyCaps in their own code is precisely why it should be adopted in OO code, so that overloading won't result in a mishmash of styles. George

« previous php.internals (#8775) next »