Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:8778 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85152 invoked by uid 1010); 26 Mar 2004 15:01:02 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 85127 invoked from network); 26 Mar 2004 15:01:01 -0000 Received: from unknown (HELO mx.thebrainroom.net) (65.200.24.98) by pb1.pair.com with SMTP; 26 Mar 2004 15:01:01 -0000 Received: by mx.thebrainroom.net (Postfix, from userid 517) id 98DBA148809C; Fri, 26 Mar 2004 07:01:03 -0800 (PST) Received: from tron (zaneeb.thebrainroom.net [82.133.1.138]) by mx.thebrainroom.net (Postfix) with ESMTP id 16D8D148809B for ; Fri, 26 Mar 2004 07:01:01 -0800 (PST) Message-ID: <00c201c41343$32eb8950$8a02a8c0@tron> To: Date: Fri, 26 Mar 2004 15:01:19 -0000 Organization: The Brain Room Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Spam-Status: No, hits=0.4 required=5.0 tests=AWL,BAYES_30,NEW_DOMAIN_EXTENSIONS version=2.55 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) X-TBR-Filter: Virus scanned and defanged Subject: studlyCaps conclusion From: wez@thebrainroom.com ("Wez Furlong") Lets create an engine level option, lets calls it "coding_convention". The default is "studlyCaps". Consider the following code: $foo->fooBarBaz(); When coding_convention=studlyCaps, the engine will resolve the method thus (psuedo code): if (!method_exists($obj, $methodname)) { $tmp_method_name = convert_to_underscored_name($methodname); if (!method_exists($obj, $tmp_method_name)) { error("undefined method $methodname"); } $methodname = $tmp_method_name; } $obj->$methodname(...) When coding_convention=underscores, the engine will resolve it thus: if (!method_exists($obj, $methodname)) { $tmp_method_name = convert_to_studly_name($methodname); if (!method_exists($obj, $tmp_method_name)) { error("undefined method $methodname"); } $methodname = $tmp_method_name; } $obj->$methodname(...) For the speed concious, there will be a configure option to either remove the coding convention checks completely. This approach will keep allow us to keep whichever coding style we end up deciding on (although I suspect we won't reach a decision until PHP 7), while meanwhile allowing the end user a transparent choice of their preference for PHP methods. Let's stop arguing about this stuff--we all have MUCH more important things to do with our time. My point of view on this: - The guideline is to stick with studlyCaps for OO extensions for consistency with PEAR. - New OO extensions SHOULD try to follow the guideline, but are not required to (no need to create more work for our limited developer resources). Now, if the authors/maintainers of an OO extension want to change to studlyCaps, let them do so (I have no objection to SQLite OO api being changed), but lets not force people that otherwise have no time and have spent a lot of effort over a long period of time (eg: Georg) to rewrite their extensions. [keep in mind that one of the reasons that mysqli was written the way it is to keep it closer to the native library API; changing that is just re-introducing a nightmare for the maintainer.] I've said my piece; lets get over it and get on with it. --Wez.