Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31212 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49331 invoked by uid 1010); 23 Jul 2007 17:03:01 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 49299 invoked from network); 23 Jul 2007 17:03:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jul 2007 17:03:01 -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 63.205.162.114 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 63.205.162.114 unknown Windows 2000 SP4, XP SP1 Received: from [63.205.162.114] ([63.205.162.114:31651] helo=us-ex1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 74/68-27148-D3FD4A64 for ; Mon, 23 Jul 2007 13:02:59 -0400 Received: from [127.0.0.1] ([192.168.16.180]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 23 Jul 2007 10:02:50 -0700 Message-ID: <46A4DF33.1030403@zend.com> Date: Mon, 23 Jul 2007 10:02:43 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: Giedrius D CC: Brian Moon , =?ISO-8859-1?Q?David_Z=FClke?= , PHP Internals References: <46A31D95.2080407@fischer.name> <46A4661A.6080202@zend.com> <200707231140.55535.pstradomski@gmail.com> <46A4BA4F.6090506@dealnews.com> <40CA6572-030F-43E2-8706-64D1167C527C@bitxtender.com> <46A4C090.50402@php.net> <3d1a63d10707230942y2b2504d1p5f995f01d28a622b@mail.gmail.com> In-Reply-To: <3d1a63d10707230942y2b2504d1p5f995f01d28a622b@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 23 Jul 2007 17:02:50.0424 (UTC) FILETIME=[4D2ACB80:01C7CD4B] Subject: Re: [PHP-DEV] Question about Namespace patch From: stas@zend.com (Stanislav Malyshev) > If you use that Vendor1 lib in one.php file a lot you clutter your code > with > Vendor1::A, Vendor1::B, Vendor1::C, etc. It is possible to rename Vendor1 > to something shorter using import but you still have to prefix it. I see no problem with Vendor1::A, it's not overly long. When you have Vendor1::A::B::C::D::E then it's long, but you can shorten that. Of course, if you use many different sets with very narrow cross-section it may mean you'd have still to use long names or have a bunch of imports, but putting everything into global space in no way would solve the problem - as I mentioned, good names run out pretty fast, and blanket import means you can never use a plain English word to name any class in your application - because there's a high probability that somebody else would use the same word and thus your library becomes incompatible with his once both are imported. That is on top of a myriad of technical problems that blanket imports bring (think complete impossibility of compile-time name resolution and the trouble of maintaining separate per-file global scopes). Also, having a bunch of imports is not that bad if you use a tool - like an IDE - to assist with it. > That's why people sometimes want to import *all* names from namespace. I understand why they may want this, but implementing such functionalities opens a very large can of very nasty worms - since libraries start being import-incompatible and then people start making names like Vendor1_Module_Submodule_Exception all over again just to allow their library to be imported with other library. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com