Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31171 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85559 invoked by uid 1010); 23 Jul 2007 08:22:45 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 85543 invoked from network); 23 Jul 2007 08:22:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jul 2007 08:22:45 -0000 Authentication-Results: pb1.pair.com header.from=jeremy@peak8solutions.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=jeremy@peak8solutions.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain peak8solutions.com from 69.50.1.43 cause and error) X-PHP-List-Original-Sender: jeremy@peak8solutions.com X-Host-Fingerprint: 69.50.1.43 unknown Received: from [69.50.1.43] ([69.50.1.43:10080] helo=peak8solutions.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 09/C3-49395-35564A64 for ; Mon, 23 Jul 2007 04:22:44 -0400 Content-class: urn:content-classes:message Date: Mon, 23 Jul 2007 02:22:33 -0600 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PHP-DEV] Question about Namespace patch Thread-Index: AcfNAWF8X2PGOaXCR8+To/mLo7sWqAAAEPFA X-MimeOLE: Produced By Microsoft Exchange V6.5 References: <46A31D95.2080407@fischer.name> <46A42220.7010600@zend.com> <46A45B12.80402@zend.com> To: "Alexey Zakhlestin" Cc: "Stanislav Malyshev" , "Derick Rethans" , "Markus Fischer" , "internals" Subject: RE: [PHP-DEV] Question about Namespace patch From: jeremy@peak8solutions.com ("Jeremy Privett") Alexey, I honestly wish that were the case with the situation I'm dealing with at my current job. And I know a lot of people that are absolutely in the same boat as I am. I definitely understand your reasoning here, but we're obviously talking about design versus convenience. This is one of those situations where convenience makes the difference. Was there ever a decision on whether or not the patch is going to be backported to PHP5? I think I'll grab a PHP6 snapshot and toy around with the implementation a bit. Who knows ... it may grow on me. We'll see. Thanks. --- Jeremy Privett Software Developer Peak8 Solutions -----Original Message----- From: Alexey Zakhlestin [mailto:indeyets@gmail.com]=20 Sent: Monday, July 23, 2007 2:14 AM To: Jeremy Privett Cc: Stanislav Malyshev; Derick Rethans; Markus Fischer; internals Subject: Re: [PHP-DEV] Question about Namespace patch In reality, it is rarely (almost never) needed to import all the classes. Usually you need 2-4 per file, not more, and importing just what you really need is the step to a clean design. You don't need to import every class which is used implicitly, only those which are explicitly used. On 7/23/07, Jeremy Privett wrote: > Stanislav, > > Absolutely not the case. Take a look at C++, C#, even Python. The > "namespaces" implementation of those languages is mostly consistent > (even if Python doesn't call it that). > > You're not helping developers at all with this implementation. If you're > working with a large library and have to import a lot of classes, the > way this works is nothing but a pain. We would be better off not using > namespaces at all, in this case. Thus, the problem has not been solved. > > Also, for the implementation to be complete, Core Developers and > Extension Developers would need to namespace their classes / functions. > And that, undoubtedly, is a LOT of work. I can understand this being the > justification for implementing namespaces in the way it's been > implemented, because all of this other stuff in the global namespace, > but you still need to offer developers *some* way of importing > everything out of a namespace. I absolutely will have upwards to close > to 25 - 30 classes in a single namespace. And sometimes more. To be able > to import them all is an absolute necessity for this implementation to > be remotely feasible. Having an import block at the top of files that's > that huge just doesn't make any sense. And that doesn't even consider > the fact that I may be using OTHER libraries as well that may be > namespaced. > > PEAR is a perfect example of this. Look at all the libraries that exist > there. I would absolutely love to just: > > import PEAR; > import PEAR::HTTP; > import PEAR::Image; > > And not have to worry about going through and picking out every little > individual class that I need. And with all of the languages I mentioned > before, that is *exactly* how it works. Of course, we're back to the > namespacing of the PHP Core and Extensions. Which is really the main > blocker to any serious namespaces implementation, beyond what's > currently patched to HEAD today, correct? > > I hope you can better see my viewpoint, now that I actually had the time > to sit down and type out a more coherent reply. This implementation and > the unicode.semantics discussion have to be the most frustrating points > PHP6 has for me, right now. > > Thanks. > > --- > Jeremy Privett > Software Developer > Peak8 Solutions > > -----Original Message----- > From: Stanislav Malyshev [mailto:stas@zend.com] > Sent: Monday, July 23, 2007 1:39 AM > To: Jeremy Privett > Cc: Derick Rethans; Markus Fischer; internals > Subject: Re: [PHP-DEV] Question about Namespace patch > > > And that's exactly why this implementation isn't intuitive. As far as > I > > can see from the way it's been explained, so far, that is not > possible. > > No implementation is "intuitive", unless by "intuitive" you mean "works > as in that other language I know". Too bad in each of these languages it > > works differently :) > -- > Stanislav Malyshev, Zend Software Architect > stas@zend.com http://www.zend.com/ > (408)253-8829 MSN: stas@zend.com > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --=20 Alexey Zakhlestin http://blog.milkfarmsoft.com/