Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39838 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8745 invoked from network); 11 Aug 2008 20:23:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Aug 2008 20:23:37 -0000 Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.163 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.163 il-gw1.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.163] ([212.25.124.163:40831] helo=il-gw1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 91/02-30561-8CF90A84 for ; Mon, 11 Aug 2008 16:23:36 -0400 Received: from us-ex1.zend.com ([192.168.16.5]) by il-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 11 Aug 2008 23:24:24 +0300 Received: from [192.168.16.110] ([192.168.16.110]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 11 Aug 2008 13:24:20 -0700 Message-ID: <48A09FF4.1030101@zend.com> Date: Mon, 11 Aug 2008 13:24:20 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lukas Kahwe Smith CC: Marcus Boerger , internals@lists.php.net References: <909776579.20080803142659@marcus-boerger.de> <840985F2-A701-4BE4-91F6-F6B39048CF9B@pooteeweet.org> In-Reply-To: <840985F2-A701-4BE4-91F6-F6B39048CF9B@pooteeweet.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 11 Aug 2008 20:24:20.0942 (UTC) FILETIME=[3CB72EE0:01C8FBF0] Subject: Re: [PHP-DEV] Inconsistencies in 5.3 From: stas@zend.com (Stanislav Malyshev) Hi! > Ideally someone would summarize the discussion (or maybe two people, one > from each "camp") and then we can have a vote. Make it an RFC or OK, here it goes again: When we adopt some syntax, especially syntax matching some other language, we do not just introduce an otherwise meaningless sequence of symbols to be learned by users. We introduce concepts, and we create associative links with other languages. So, if we introduced the syntax for namespaces that is used by C++ - i.e. braces, we would imply that it has all the properties that C++ one has and that we encourage the usage patterns that C++ users adopt. Namely, that namespaces can be nested, that they are hierarchical, that namespaces can be used in any place in the file, just for one function/class or even variable without any influence on the surroundings, that using multiple namespaces in the same file, along with global space, is completely OK. However, the usage that we want to promote in PHP is very different - we want to encourage users to use one namespace per file (except for number of hacks that basically pack multiple logical files into one physical file), that namespace is to encompass big structured pieces of code and not to be used in random in-and-out fashion. Added to that, braced namespaces would imply additional (and unnecessary) level of hierarchy and indentation for most editors and code formatters. Of course, special exception can be programmed into them to make namespace{} behave in a different way from all other constructs having {} blocks, but this would be working on solving the problem that we ourselves created, quite unnecessarily. With all that, there's not one thing that syntax with {} enables us to do and that is not possible to do right now (and that we want to do :). Only reason presented for this change is the misguided notion of "consistency", grounded in the belief that semantically different constructs must look the same, because that way they will be... well, "consistent". While similarity in function in many cases should produce similarity in looks, I believe there's substantial semantic difference between namespaces and classes or functions, enough to make them use different syntax, especially when it better fits the function namespaces are to serve in PHP. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com