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


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to