Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33702 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92558 invoked by uid 1010); 5 Dec 2007 01:13:29 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 92543 invoked from network); 5 Dec 2007 01:13:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Dec 2007 01:13:29 -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.162 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.162] ([212.25.124.162:5127] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DF/B1-10080-83BF5574 for ; Tue, 04 Dec 2007 20:13:29 -0500 Received: from us-ex1.zend.com ([192.168.16.5]) by mx1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 5 Dec 2007 03:13:25 +0200 Received: from [192.168.16.91] ([192.168.16.91]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 4 Dec 2007 17:13:22 -0800 Message-ID: <4755FB31.2050901@zend.com> Date: Tue, 04 Dec 2007 17:13:21 -0800 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Derick Rethans CC: PHP Developers Mailing List References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 05 Dec 2007 01:13:22.0161 (UTC) FILETIME=[0733F610:01C836DC] Subject: Re: [PHP-DEV] RFC: Dropping Namespace From: stas@zend.com (Stanislav Malyshev) > following some discussions on the list (re. multiple namespaces in file) > as well as a short discussion on IRC regarding not being able to do > "use yeti::xml::DomDocument as DomDocument;" - I do not see any point in having You mean like ability to override existing classes? I think it could be done but I don't see it as a good idea - it probably would lead to some weird programming mistakes. > 1. As it is impossible to do "use XXX as NativeClass" we get to the > point where we'd have to namespace new internal native classes > otherwise we might introduce BC breaks. AFAIK, we've always said that There's very easy solution to this, if it ever becomes a problem - using two-component names. > 2. You have to import every class yourself. You can currently not do: > > use myNamespace::* as *; // or similar syntax Right, you can't - but you can use two-component names, i.e. myNamespace::Name. > 3. We keep bickering over using { } or not, multiple namespaces in a > file or not... etc. I understand that people want more flexibility, > but also we need a *simple* to explain implementation. With the That's why not all flexibility gets in. > - You can't stick multiple namespaces in one file You are not supposed to unless you using it as performance solution, which is rather dubious practice anyway. > - Unlike other constructs in PHP that mark executable blocks, > namespaces don't use { }. That's because namespaces are not executable blocks. > - The "namespace" keyword at the start of a file is somewhat magic, > because it can only appear as first element in your script. Yes, it is somewhat magic, because it changes how names behave. If the whole thread is really reincarnation of the braces theme - I think you could just link to the archive, as I don't see any arguments here that weren't discussed to death three times. > 4. What is wrong with simple prefixes in the first place? Both PEAR_*, > Zend_*, ezc*, and ezp* are perfectly acceptable markers for different > 'namespaces'. We could optionally create a registry on php.net for > this to avoid conflicts. What is wrong is names like PEAR_DB_Data_Database_Module_Adapter_Implementation_Interface_Exception_Information_Collection_Element. When you write a code that uses such names, you really don't want to repeat all the thing every time. > useful - or what particular case they solve... so I am wondering, are they > really useful? I come now to the conclusion that they are not, and for myself Yes, they are. > (and most likely my work projects) I would have to decide not to go with > namespaces, but instead stick with the 3 letter prefixing. Something that I Well, the loss is all yours :) -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com