Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33815 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53026 invoked by uid 1010); 6 Dec 2007 21:59:34 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 53009 invoked from network); 6 Dec 2007 21:59:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Dec 2007 21:59:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=sam@sambarrow.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=sam@sambarrow.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain sambarrow.com from 205.234.132.11 cause and error) X-PHP-List-Original-Sender: sam@sambarrow.com X-Host-Fingerprint: 205.234.132.11 scottsdale.servershost.net Received: from [205.234.132.11] ([205.234.132.11:53344] helo=scottsdale.servershost.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/9D-15167-5C078574 for ; Thu, 06 Dec 2007 16:59:33 -0500 Received: from [65.207.49.92] (port=57016) by scottsdale.servershost.net with esmtpsa (SSLv3:RC4-MD5:128) (Exim 4.68) (envelope-from ) id 1J0Okl-0006CT-KA; Thu, 06 Dec 2007 15:59:31 -0600 To: scott.mcnaught@synergy8.com Cc: 'Michael McGlothlin' , internals@lists.php.net In-Reply-To: <000301c83834$aca8af10$05fa0d30$@mcnaught@synergy8.com> References: <475713B2.4030802@iamjochem.com> <475719ED.8050306@zend.com> <200712052110.37023.larry@garfieldtech.com> <47576AEF.4030306@omegavortex.net> <5474E017-DF97-4B91-8FE0-7D6831E64F56@bitxtender.com> <47582DC0.2040004@zend.com> <16F02B8A-6394-4175-9473-C4967606386C@bitxtender.com> <4758362B.8070504@swplumb.com> <47583783.4010904@zend.com> <47583ABB.5050306@swplumb.com> <000301c83834$aca8af10$05fa0d30$@mcnaught@synergy8.com> Content-Type: text/plain Date: Thu, 06 Dec 2007 16:59:18 -0500 Message-ID: <1196978358.28351.8.camel@sbarrow-desktop> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - scottsdale.servershost.net X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - sambarrow.com X-Source: X-Source-Args: X-Source-Dir: Subject: RE: [PHP-DEV] Namespace From: sam@sambarrow.com (Sam Barrow) You have a point, however it is not always this simple. Some applications have classes/functions that are not necessarily gathered in order by their namespaces. It would be a nightmare to try to organize and then bundle these functions and classes together dynamically into different files by namespace. So far I agree with most of the opinions regarding namespaces on here, but I do think it would be best to allow multiple namespaces per file. People say this will be confusing, but namespace declarations are pretty clear, as in clean code they should be on their own line: namespace usefulStuff ; class a {} function z() {} Yes it has slight potential for chaotic code, but there are hundreds of ways to create chaotic code, and this is nowhere near the top of the list. I believe that the benefits of bundling (huge performance increases in my case) outweigh the risks. This may not apply to small projects with 2 or 3 namespaces, we also have to consider larger ones. On Fri, 2007-12-07 at 04:20 +1000, scott.mcnaught@synergy8.com wrote: > Just a thought... You know the whole thing about bundling into one file > improving performance. People do this when they have upwards of 20 classes > being included per request. I bet that most of the time these classes are a > part of a framework / something that would be a part of common name space > anyway. > > The whole "One namespace per file" policy will not stop people from bundling > their classes. It will still allow them to bundle, but they will be > restricted to just one file per namespace. > > So given a situation where someone has a library of around 20 classes... > Where they would normally bundle down to one file... They bundle it down to > 3 files, one for each namespace... There is hardly going to be much of a > performance difference between 1 and 3 includes. > > I guess the point I am saying is that everyone is freaking out about the > possible performance loss - but in reality you can still bundle and get 90% > of the bundling gain. > > SCOTT MCNAUGHT > Software Developer > > Synergy 8 / +617 3397 5212 > scott.mcnaught@synergy8.com >