Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26365 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52079 invoked by uid 1010); 5 Nov 2006 18:32:35 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 52064 invoked from network); 5 Nov 2006 18:32:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Nov 2006 18:32:35 -0000 Authentication-Results: pb1.pair.com smtp.mail=cschneid@cschneid.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=cschneid@cschneid.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain cschneid.com from 195.226.6.42 cause and error) X-PHP-List-Original-Sender: cschneid@cschneid.com X-Host-Fingerprint: 195.226.6.42 darkcity.gna.ch Linux 2.5 (sometimes 2.4) (4) Received: from [195.226.6.42] ([195.226.6.42:41605] helo=mail.gna.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3C/EA-10980-24E2E454 for ; Sun, 05 Nov 2006 13:32:35 -0500 Received: from localhost (localhost [127.0.0.1]) by darkcity.gna.ch (Postfix) with ESMTP id 7CBFFD10CC; Sun, 5 Nov 2006 19:32:31 +0100 (CET) Received: from unknown by localhost (amavisd-new, unix socket) id client-XXNzkj9e; Sun, 5 Nov 2006 19:32:30 +0100 (CET) Received: from [192.168.1.42] (217-162-171-242.dclient.hispeed.ch [217.162.171.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTP id 5BB6CD10C4; Sun, 5 Nov 2006 19:32:30 +0100 (CET) Message-ID: <454E2E20.6090909@cschneid.com> Date: Sun, 05 Nov 2006 19:32:00 +0100 User-Agent: Thunderbird 1.5.0.7 (Macintosh/20060909) MIME-Version: 1.0 To: Ilia Alshanetsky CC: internals@lists.php.net References: <005e01c6ff82$e6092c30$ec01010a@intranet.db> <2FAA3BA3-283C-445D-9648-70C207FF2251@prohost.org> <454CBD65.5040205@cschneid.com> <454D66C4.2090708@cschneid.com> <303397962.20061105053913@marcus-boerger.de> <454D6EDE.60202@cschneid.com> <454E2670.4050806@cschneid.com> <9FF4D6D2-2F94-46AA-B13A-75F51C95892A@prohost.org> In-Reply-To: <9FF4D6D2-2F94-46AA-B13A-75F51C95892A@prohost.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at gna.ch Subject: Re: [PHP-DEV] New Datetime class problem From: cschneid@cschneid.com (Christian Schneider) Ilia Alshanetsky wrote: > There are no "rules" there is just one rule, that's not even specific to > PHP when you think of it. It is generally considered to be a good > practice to prefix your code with app name or similar to avoid conflicts > with other libraries and/or applications. When it comes to this rule, I > think it is one of the very few that are essential for developers to learn. What about "do not trust user input"? Or "avoid copy/pasting code, refactor instead"? Or "use descriptive identifiers"? Those are all rules to be followed when programming. And the more there are the more experience it takes to not get any of them wrong. >> This would mean classes should be prefixed by extension name... > > That is the common case, yes. In fact the date extension's classes > follow this convention to the letter. DateTime + DateTimeZone (Date > is the extension name). Well, almost: DateTime is a date class, not a time class. > However, for native classes there maybe exceptions to simplify usage, > when a need for such exceptions arise this will be discussed on this list. We're only talking about native classes anyway. And I think not bending the rules simplify usage more than saving a couple of letters. Wasn't that a lesson we learned from functions? - Chris