Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40367 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11666 invoked from network); 8 Sep 2008 18:45:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Sep 2008 18:45:52 -0000 Authentication-Results: pb1.pair.com header.from=robert@interjinn.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=robert@interjinn.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain interjinn.com from 66.11.173.122 cause and error) X-PHP-List-Original-Sender: robert@interjinn.com X-Host-Fingerprint: 66.11.173.122 unknown Received: from [66.11.173.122] ([66.11.173.122:27803] helo=interjinn.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B0/67-13670-7B275C84 for ; Mon, 08 Sep 2008 14:45:29 -0400 Received: from [192.168.1.3] (blobule.suds [192.168.1.3]) by interjinn.com (Postfix) with ESMTP id DD9D711FB77; Mon, 8 Sep 2008 14:44:58 -0400 (EDT) To: Elizabeth M Smith Cc: Stanislav Malyshev , internals@lists.php.net In-Reply-To: <48C5715C.2070102@shitennou.com> References: <486FA5FB.1000300@php.net> <48C55855.4080602@zend.com> <48C5624A.1040901@zend.com> <48C56743.2060706@zend.com> <48C56821.2040805@shitennou.com> <48C5695E.1010404@zend.com> <48C56A51.1000307@shitennou.com> <48C56CEE.6050807@zend.com> <48C56DED.4010407@shitennou.com> <48C57045.6020003@zend.com> <48C5715C.2070102@shitennou.com> Content-Type: text/plain Organization: InterJinn Date: Mon, 08 Sep 2008 14:45:35 -0400 Message-ID: <1220899535.8241.1176.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: towards a 5.3 release From: robert@interjinn.com (Robert Cummings) On Mon, 2008-09-08 at 14:39 -0400, Elizabeth M Smith wrote: > Stanislav Malyshev wrote: > > Hi! > > > >> And what happens when you have two libraries and each has their own Date > >> implementation? How is that any different? If you could alias in > >> functions, you'd simply alias them in differently - call one _() and one > >> new_gettext - that's the point of aliasing, to avoid collisions > > > > It's not different. But if you can have _() and new_gettext() - how > > exactly is it so much better than Foo::_() and Bar::_()? So different > > that the former is OK but the latter is absolutely useless? Just because > > it the latter has ::? > > What is the point? Wouldn't it be just as well to have static methods > in a class instead? What do I gain by having functions in namespaces? > For me it's useless because there's another way to do exactly the same > thing...don't we already have enough of that in PHP? Bad argument... there's another way to do namespaces without namespaces too... it's called prefixing. Many, many, MANY developers still take a procedural approach to development and as such many functions have the naming conflicts. These libraries (as they may be) are not necessarily under the control of the person wanting to use them and so punting functions to classes may not be a viable option. > > >> libraries. Let's just say it was an eye opening experience, and where > >> my opinion that functions in namespace are essentially useless came from > >> , since it forces procedural coders to totally alter the way they're > >> accustomed to writing code. > > > > Well, yes, I guess it would make procedural coders be acquainted with > > ::. Which is IMHO about time if they want namespaces - namespaces is OO > > feature, so they can't have it both ways - use the sweet OO goodies but > > stay with old procedural mindset. :) > > hehe - devil's advocate here - in that case why have functions in > namespaces at all? I can see a case for constants ...but not functions. > If functions in namespaces won't have the same treatment or features as > classes why bother ;) Why bother indeed... why bother with anything? it serves to satisfy a need. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP