Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33852 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18038 invoked by uid 1010); 7 Dec 2007 20:56:04 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 18023 invoked from network); 7 Dec 2007 20:56:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Dec 2007 20:56:04 -0000 Authentication-Results: pb1.pair.com header.from=sam@sambarrow.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=sam@sambarrow.com; spf=permerror; 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:46829] helo=scottsdale.servershost.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0D/28-00432-363B9574 for ; Fri, 07 Dec 2007 15:56:04 -0500 Received: from [65.207.49.92] (port=60234) by scottsdale.servershost.net with esmtpsa (SSLv3:RC4-MD5:128) (Exim 4.68) (envelope-from ) id 1J0kEg-0007bf-5e; Fri, 07 Dec 2007 14:55:50 -0600 To: Robert Cummings Cc: Ken Stanley , Lokrain , internals@lists.php.net In-Reply-To: <1197058210.14915.98.camel@blobule> 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> <4EE0727E-ABBA-490D-B247-8C6E9A9727BA@gmx.net> <345fd5cd0712070815k55eac42fh14d5685039c03113@mail.gmail.com> <345fd5cd0712070816m2c0d4a22hd03f91abff2405ae@mail.gmail.com> <1197058210.14915.98.camel@blobule> Content-Type: text/plain Date: Fri, 07 Dec 2007 15:55:32 -0500 Message-ID: <1197060932.28351.31.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) Very good point namespace stuff ; { function myfunction() { return true ; } } That would actually work, but it's not quite the same as you have the semicolon after the namespace declaration, which looks kind of stupid. Overall i dont think braces are a bad idea. People say multiple namespaces per file are confusing, but braces would partially solve this. If using braces makes multiple namespaces per file more likely, I say that's the way to go, as I am very much in favor of multiple namespaces per file. On Fri, 2007-12-07 at 15:10 -0500, Robert Cummings wrote: > On Fri, 2007-12-07 at 14:57 -0500, Ken Stanley wrote: > > In regards to the braces or no braces question, I have a scenario that I > > would like to share that could be considered similar in nature. We use a > > cluster of databases where I work, and to make things easier on us, we have > > a method called setSource() to switch between the clusters in our database > > class. This allows us to easily query between the clusters, but since there > > are no braces, we sometimes lose track of which cluster we are working on, > > and thus bugs are born. I would think that if it were some how possible to > > have braces, it would cause less headaches and problems, because we could > > then logically group our queries together. The same argument could be used > > with namespaces; especially _if_ the multiple namespace-per-file gets added. > > Even without that little bit of functionality, it would make maintaining > > namespaced code easier to read at first glance. For small apps, it probably > > wouldn't be that big of a difference, but for files that span hundreds (and > > even thousands) of lines of code, a developer could easily get lost in in > > the namespace they are supposed to be in. Am I in a namespace? Which > > namespace? Without the code block, and typical indentation, you could easily > > overlook the namespace keyword. > > > > Anyways, I understand that braces are just a bit of icing on the cake -- so > > to speak -- but I just wanted to give a probable real-life situation to this > > debate. :) > > Is there any reason why you can't already use braces optionally? I mean, > the following code is valid with the current engine: > > > { > { > { > class Foo > { > function Foo() > { > echo 'Foo'."\n"; > } > } > } > } > } > > ?> > > Cheers, > Rob. > -- > ........................................................... > SwarmBuy.com - http://www.swarmbuy.com > > Leveraging the buying power of the masses! > ........................................................... >