Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:6256 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80997 invoked by uid 1010); 6 Dec 2003 16:57:39 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 80959 invoked from network); 6 Dec 2003 16:57:38 -0000 Received: from unknown (HELO stella.fastforwardnetwork.com) (209.51.153.50) by pb1.pair.com with SMTP; 6 Dec 2003 16:57:38 -0000 Received: (qmail 423 invoked from network); 6 Dec 2003 18:00:24 -0000 Received: from p508a9954.dip.t-dialin.net (HELO hristov.com) (80.138.153.84) by d.goto.bg with SMTP; 6 Dec 2003 18:00:24 -0000 Message-ID: <3FD20AAE.30909@hristov.com> Date: Sat, 06 Dec 2003 17:58:22 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.6b) Gecko/20031202 X-Accept-Language: en-us, en MIME-Version: 1.0 To: George Schlossnagle CC: internals@lists.php.net References: <5.1.0.14.2.20031203223915.02f7fb00@127.0.0.1> <200312061001.hB6A1E8M032486@mailserver3.hrz.tu-darmstadt.de> <20031206161404.GA13130@prp0.prp.physik.tu-darmstadt.de> <8F46C0C1-280B-11D8-B53A-000393B2B3C0@omniti.com> In-Reply-To: <8F46C0C1-280B-11D8-B53A-000393B2B3C0@omniti.com> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] StudlyCaps From: php@hristov.com (Andrey Hristov) George Schlossnagle wrote: > > On Dec 6, 2003, at 11:14 AM, Stefan Walk wrote: > >> On Sat, Dec 06, 2003 at 10:59:33AM +0100, Sebastian Bergmann wrote: >> >>> PHP's internal *function names* should use _ to delimit between >>> words. >> >> [snip] >> >>> And this what we should *consistently* adopt for the naming of PHP's >>> internal *method names*. >> >> >> Why should methods differ from functions in naming? That in itself is >> inconsistency... >> >> I'm in favour of naming with underscores, simply because that was the >> PHP way until now and it helps readability a lot. > > > This is not really true. In PHP4 there were very few internal classes, > so there was not much of a standard for naming class methods. In > contrast, PEAR has had a large amount of OO code in it and conforms to > StudlyCaps. The whole user-space/internal differentiator argument is > of course bogus because OOP relies on method overloading, so if you > want to extend the internal classes in your userspace code, you are > forced to adopt underscores as well. It's hard but not impossible to extend internal classes. The workaround is to write thin wrappers with the studlyCaps convention which only just call the methods in their parents like INTERNAL_FUNCTION_PARAM_PASSTHRU. After then comes the real class that extends the functionality by extending the wrapper. So if another class extends the latter it does not have to know that the top into the hierarchy is an internal class that uses different naming convention. Anyway, this is an way to workaround, not completely clean but can help. Andrey