Welcome! Log In Create A New Profile

Advanced

Re: [PHP-DEV] alpha2 scheduled

Posted by Andrew Mason 
Andrew Mason
Re: [PHP-DEV] alpha2 scheduled
October 27, 2008 04:15PM
I think the majority of the namespaces stuff is fine. However, having
read the irc discussion about how the namespaces seperator was decided
upon, i don't think there are many people here who can honestly say
that ease of typing is that big of a deal compared to maintainability
and being able to easily read the code.

Both Perl and C++ use :: to success. i don't know how much of an
overlap there is in PHP and Perl or C++ programmers, so I'm not
suggesting it for familiarity reasons, but i have never heard anyone
say "i wish C++/ Perl used a different namespace separator.

Stas: I believe you work for Zend ? Have you tried going through ZF
and namespaced a few of the modules (using \ ) and then the code that
uses it ?

I tried to give it a go today with our framework internally and while
i know the '\' has its merits, the code ( to us at least ) felt more
cluttered. I will continue to use it for a few weeks as I have done
C++ and Perl programming so familiarity might alter my perception.

Where you can use the 'use' statements, i will admit, its not _that_
bad. If you have alot of overlap with a 3rd parties code base and
'use' doesn't work so well then it becomes very difficult to read. At
least for my simple mind.

I know that you say the majority of people didn't 'care' up until now
but I feel thats untrue. The majority of people (I believe ) simply
thought that namespaces was heading in the right direction. I for one
was in this group although i have been mildly active on the list.

The old style long class names approach of ,

$bar = new Module_Name_Foo_Bar();

imho is more clear than

$bar = new Module\Name\Foo\Bar();

I still struggle to see how the :: is confusing or difficult to type.
$bar = new Module::Name::Foo::Bar();

Even if this was erroneous with syntax highlighting and the syntax
checker i really don't think its going to cause that much grief ( esp
given Perl / C++ ) have had it for a while.

is the below allowed ?

$bar = new Module \ Foo \ Bar();

I find it easier to read than with out the space.

i know with real namespaces you don't have to call the class Module_Foo_Bar
but i think a few people might be considering sticking with the long
classname approach.

Many of the PHP community as a whole been very supportive of everyone
working on the namespaces implemenation. There are a few vocal people
on this list but the majority I think are quite happy with what was
proposed previously. God knows we couldn't come up with a better
implementation but it would be nice if you could all remember that we
are using it day in day out as well. You have obviously seen how many
people 'care' now , and my guess is that it's largely because they
think this will have a big impact on their day to day use of the
language.

Since I haven't offered anything in the way of a solution yet, if i
were to write something that allowed the users to choose which
separator we used would that be considered ? If not, is it possible
that you could ( if its not already) make it trivial to change for
those of us who are willing to apply our own patches each time for our
particular machines. I don't think forking the project would achieve
much but it would be nice if I could maintain a small patchset which
could be applied to each release. That way those who want it can have
it.

I'm not saying that '\' is a bad decision, They were all good reasons,
I'm simply saying that there are a significant number of users who
place a different priority on the reasons that those who made the
decision.

thank you for your time
Andrew



On Sat, Aug 30, 2008 at 5:30 AM, Stanislav Malyshev <[email protected]> wrote:
> Hi!
>
>> Seems like you are answering lot of questions about namespaces lately
>> with "that's not how the model was designed".
>
> Not really, and it's not the reason, the reason why it wasn't designed that
> way was explained before and was explained again.
>
>> Guess it should have been designed in the open to begin with.
>
> It was. Just a lot of people couldn't care less until it is a day before
> feature freeze and then they wake up and want whole thing rewritten from
> scratch, and don't even take time to think about what their changes really
> mean and how it is going to work with all other parts of the language.
> Namespaces is not the only case btw.
> --
> 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
>
>

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Johannes Schl
Re: [PHP-DEV] alpha2 scheduled
October 27, 2008 04:35PM
On Tue, 2008-10-28 at 01:43 +1030, Andrew Mason wrote:
> Both Perl and C++ use :: to success. i don't know how much of an
> overlap there is in PHP and Perl or C++ programmers, so I'm not
> suggesting it for familiarity reasons, but i have never heard anyone
> say "i wish C++/ Perl used a different namespace separator.

Yes, and as said multiple times: Using "::" is impossible and
alternatives were discussed multiple times, decision was made with
discussions over multiple years now.

So please let's move on and in a year or two we won't hear "anyone say
"i wish PHP used a different namespace separator""

Thanks for no further wasting of time. (neither yours nor mine, ...)
(except you find somethign which wasn't discussed within the last 5 yrs)

johannes


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Anonymous User
Re: [PHP-DEV] alpha2 scheduled
October 27, 2008 04:55PM
I found that he had one valid question that i would like to see answered.

> is the below allowed ?
>
> $bar = new Module \ Foo \ Bar();
>
> I find it easier to read than with out the space.

Since it looks pretty good with the spaces there.

2008/10/27 Johannes Schl
Hannes Magnusson
Re: [PHP-DEV] alpha2 scheduled
October 27, 2008 05:55PM
On Mon, Oct 27, 2008 at 16:50,
Johannes Schl
Re: [PHP-DEV] alpha2 scheduled
October 27, 2008 06:30PM
On Mon, 2008-10-27 at 17:53 +0100, Hannes Magnusson wrote:
> On Mon, Oct 27, 2008 at 16:50, ├ôlafur Waage <[email protected]> wrote:
> > I found that he had one valid question that i would like to see answered.
> >
> >> is the below allowed ?
> >>
> >> $bar = new Module \ Foo \ Bar();
> >>
> >> I find it easier to read than with out the space.
> >
> > Since it looks pretty good with the spaces there.
>
> I don't see why it wouldn't be allowed. You can already do
> function_name (), or classname :: methodname
> ().
> This isn't python, the parser doesn't really care about the spaces :)

It might work in some places, not always, consider
<?php
$class = '\ foo \ bar \ baz';
new $class();
?>

as the name is stored without spaces in the class table, not sure
whether it's worth parsing whitespaces in such cases...

johannes



--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Anonymous User
Re: [PHP-DEV] alpha2 scheduled
October 27, 2008 07:25PM
> $class = '\ foo \ bar \ baz';

In those cases i get why its an issue. But when i look at:

namespace\class\method()
against
namespace \ class \ method()

I get the feeling that \ is a pretty good solution.

2008/10/27 Johannes Schl
marius popa
Re: [PHP-DEV] alpha2 scheduled
October 28, 2008 08:20AM
On Mon, Oct 27, 2008 at 5:50 PM,
Steph Fox
Re: [PHP-DEV] alpha2 scheduled
October 28, 2008 10:20AM
Hi Marius,

Don't know i never saw something so ugly since c++ templates syntax
I find it funny that php is designed by committee and no one listen to
the community
===

You have written to this list a few times before. Here's a brief summary of
your posts:

1) We should be moving to git not svn
2) We should drop $ for variables because it makes PHP 'bloated'
3) Mingw compilation (which we don't support) fails
4) If we want your help supporting firebird under Windows we should build it
and send you a report
5) We're on slashdot (for \)

===
And the team continues even if is an bad decision (they call it
technical one) if you see it from the point of view of syntax elegance
it's not so pretty even c++ looks better .
===

I'm not even going to comment on that.

- Steph




--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
marius popa
Re: [PHP-DEV] alpha2 scheduled
October 28, 2008 01:45PM
On Tue, Oct 28, 2008 at 11:17 AM, Steph Fox <[email protected]> wrote:
> Hi Marius,
>
> Don't know i never saw something so ugly since c++ templates syntax
> I find it funny that php is designed by committee and no one listen to
> the community
> ===
>
> You have written to this list a few times before. Here's a brief summary of
> your posts:
>
> 1) We should be moving to git not svn
> 2) We should drop $ for variables because it makes PHP 'bloated'
> 3) Mingw compilation (which we don't support) fails
> 4) If we want your help supporting firebird under Windows we should build it
> and send you a report
> 5) We're on slashdot (for \)
>
> ===
> And the team continues even if is an bad decision (they call it
> technical one) if you see it from the point of view of syntax elegance
> it's not so pretty even c++ looks better .
> ===
>
> I'm not even going to comment on that.
>
> - Steph
yes is true that i like to have strong opinions and yes i could be
wrong in most of them
but when all the comunity screems at the namespace issue i think
core developers should be more diplomatic and offer the good solution not
close the eyes and wash the hands and go forward

an semisolution would be an php.ini variable
like
NAMSPACE_SEPARATOR="::"
so if you have an issue with your classes can be reset to "\" or
whatever with ini_set

i think it's easy to be done if i look at the patch that created the
backslash separator issue
http://pear.php.net/~greg/backslash.sep.patch.txt

>
>
>
>



--
developer flamerobin.org

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Kalle Sommer Nielsen
Re: [PHP-DEV] alpha2 scheduled
October 28, 2008 01:55PM
2008/10/28 marius popa <[email protected]>:
> On Tue, Oct 28, 2008 at 11:17 AM, Steph Fox <[email protected]> wrote:
>> Hi Marius,
>>
>> Don't know i never saw something so ugly since c++ templates syntax
>> I find it funny that php is designed by committee and no one listen to
>> the community
>> ===
>>
>> You have written to this list a few times before. Here's a brief summary of
>> your posts:
>>
>> 1) We should be moving to git not svn
>> 2) We should drop $ for variables because it makes PHP 'bloated'
>> 3) Mingw compilation (which we don't support) fails
>> 4) If we want your help supporting firebird under Windows we should build it
>> and send you a report
>> 5) We're on slashdot (for \)
>>
>> ===
>> And the team continues even if is an bad decision (they call it
>> technical one) if you see it from the point of view of syntax elegance
>> it's not so pretty even c++ looks better .
>> ===
>>
>> I'm not even going to comment on that.
>>
>> - Steph
> yes is true that i like to have strong opinions and yes i could be
> wrong in most of them
> but when all the comunity screems at the namespace issue i think
> core developers should be more diplomatic and offer the good solution not
> close the eyes and wash the hands and go forward
>
> an semisolution would be an php.ini variable
> like
> NAMSPACE_SEPARATOR="::"
> so if you have an issue with your classes can be reset to "\" or
> whatever with ini_set

An ini value for a language operator? I don't think I know any
language that lets the end developers change the way a language looks
like by a configurative, and honestly that doesn't solve any issues if
someone uses :: as seperator unless :: is disabled.

<sarcasm>
Why not put namespaces in its own Zend extension then?
</sarcasm>

>
> i think it's easy to be done if i look at the patch that created the
> backslash separator issue
> http://pear.php.net/~greg/backslash.sep.patch.txt

Parts of the code is generated by RE2C so its not really as easy as it may look

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



--
Kalle Sommer Nielsen

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Stefan Walk
Re: [PHP-DEV] alpha2 scheduled
October 28, 2008 01:55PM
On Tuesday 28 October 2008 13:41:24 marius popa wrote:
> an semisolution would be an php.ini variable
> like
> NAMSPACE_SEPARATOR="::"
> so if you have an issue with your classes can be reset to "\" or
> whatever with ini_set

Please make this list readonly or at least moderated for non-devs (yes, that
includes me). This is getting ridiculous.

Regards,
Stefan

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Lukas Kahwe Smith
Re: [PHP-DEV] alpha2 scheduled
October 28, 2008 01:55PM
On 28.10.2008, at 13:41, marius popa wrote:

> but when all the comunity screems at the namespace issue i think
> core developers should be more diplomatic and offer the good
> solution not
> close the eyes and wash the hands and go forward

its always nice to ask for diplomacy after throwing around insults.
that being said, we have been quite calm in trying to explain the
reasons. but maybe if people would try out more reasonable forms of
inquiry it would all go a bit smoother, it takes two to tango.

at any rate, i hope that we will soon have a FAQ online that will make
it even easier (easier than reading through 3 RFC's on the wiki). not
sure when that will be ready.

> an semisolution would be an php.ini variable
> like
> NAMSPACE_SEPARATOR="::"
> so if you have an issue with your classes can be reset to "\" or
> whatever with ini_set


this will lead to incompatible code and deployment nightmares.

regards,
Lukas Kahwe Smith
mls@pooteeweet.org




--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Dave Ingram
Re: [PHP-DEV] alpha2 scheduled
October 28, 2008 01:55PM
marius popa wrote:
> an semisolution would be an php.ini variable
> like
> NAMSPACE_SEPARATOR="::"
> so if you have an issue with your classes can be reset to "\" or
> whatever with ini_set
>
> i think it's easy to be done if i look at the patch that created the
> backslash separator issue
>
So you're suggesting that part of PHP's syntax should be a
user-configurable option because you don't like the current solution?
How do you propose using code that requires the standard separator if
you change it? Or sharing code that uses a non-standard separator?


D

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Steph Fox
Re: [PHP-DEV] alpha2 scheduled
October 28, 2008 02:00PM
Hi Marius,

> yes is true that i like to have strong opinions and yes i could be
> wrong in most of them
> but when all the comunity screems at the namespace issue

"All the community" is not screaming at the namespace issue. "A minority of
the community" is, but most of that minority would scream whatever we did.

> an semisolution would be an php.ini variable
> like
> NAMSPACE_SEPARATOR="::"

:-)

Now go away and think really hard about what you wrote there, and you'll
maybe understand that smiley.

- Steph


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Stan Vassilev | FM
Re: [PHP-DEV] alpha2 scheduled
October 28, 2008 02:05PM
> an semisolution would be an php.ini variable
> like
> NAMSPACE_SEPARATOR="::"
> so if you have an issue with your classes can be reset to "\" or
> whatever with ini_set
>

You're always welcome to change the separator in the PHP source code,
compile that and use your fork as you please. The source code is the
ultimate PHP configuration ...

Regards, Stan Vassilev


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Dave Ingram
Re: [PHP-DEV] alpha2 scheduled
October 28, 2008 02:20PM
Dave Ingram wrote:
> marius popa wrote:
>
>> an semisolution would be an php.ini variable
>> like
>> NAMSPACE_SEPARATOR="::"
>> so if you have an issue with your classes can be reset to "\" or
>> whatever with ini_set
>>
>> i think it's easy to be done if i look at the patch that created the
>> backslash separator issue
>>
>>
> So you're suggesting that part of PHP's syntax should be a
> user-configurable option because you don't like the current solution?
> How do you propose using code that requires the standard separator if
> you change it? Or sharing code that uses a non-standard separator?
>

I apologise: I missed a golden opportunity for sarcasm there.

<sarcasm>
Yeah! I've also never really liked some of the other operators... let's
have:

NAMESPACE_SEPARATOR="::"
STRING_CONCATENATOR="+"
OBJECT_ACCESSOR="."
</sarcasm>

I agree with Stefan. This really is getting silly. Although I'm not sure
that permanently moderating the list is necessarily the way to go. Maybe
until people calm down and accept what the devs and RMs have decided?


D
Andrei Zmievski
Re: [PHP-DEV] alpha2 scheduled
October 28, 2008 05:10PM
marius popa wrote:
> yes is true that i like to have strong opinions and yes i could be
> wrong in most of them
> but when all the comunity screems at the namespace issue i think
> core developers should be more diplomatic and offer the good solution not
> close the eyes and wash the hands and go forward
>
> an semisolution would be an php.ini variable
> like
> NAMSPACE_SEPARATOR="::"
> so if you have an issue with your classes can be reset to "\" or
> whatever with ini_set
>
> i think it's easy to be done if i look at the patch that created the
> backslash separator issue
> http://pear.php.net/~greg/backslash.sep.patch.txt

This thread has been scheduled for demolition by the Vogon Construction Fleet. You hae
less than 2 minutes remaining to vacate the thread. Have a nice day.

-Andrei

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Kelvin
Re: [PHP-DEV] alpha2 scheduled
October 29, 2008 04:35PM
Steph

You dismiss the vocal voices far to quickly, claiming its only a minority
against this is very misleading - The majority of Developers are probably
oblivious to this conversation.

The way this argument is heating up and people are being flamed downed,
Namespaces will be known as the "Addition that killed PHP" rather than the
"Killer addition to PHP".

I'm of the opinion that using a \ is a bad idea, mostly for the same reasons
as everybody else, and I think lots of people will avoid using them like the
plague.

Since this affects everybody, it should be opened up to the community, so,
the internals should put together several options and then open a poll for
the community to vote on and then use which ever comes out on top.

Cheers
Kelvin

""Steph Fox"" <[email protected]> wrote in message
news:[email protected]
> Hi Marius,
>
>> yes is true that i like to have strong opinions and yes i could be
>> wrong in most of them
>> but when all the comunity screems at the namespace issue
>
> "All the community" is not screaming at the namespace issue. "A minority
> of the community" is, but most of that minority would scream whatever we
> did.
>
>> an semisolution would be an php.ini variable
>> like
>> NAMSPACE_SEPARATOR="::"
>
> :-)
>
> Now go away and think really hard about what you wrote there, and you'll
> maybe understand that smiley.
>
> - Steph


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Vesselin Kenashkov
Re: [PHP-DEV] alpha2 scheduled
October 29, 2008 05:05PM
>
> Since this affects everybody, it should be opened up to the community, so,
> the internals should put together several options and then open a poll for
> the community to vote on and then use which ever comes out on top.
>
> Cheers
> Kelvin


This has been done so many times... I'm following this discussion in
probably the last 2 years, but as Steph mentioned womewhere it was ongoing
for the last 5. In the last month there were votings too.
According to the last discussions looks like the main candidates for ns
separators were '\', ':::' and probably ':>'.
I think everyone (especially the core developers) is sick of discussing and
voting.



>
>
> ""Steph Fox"" <[email protected]> wrote in message
> news:[email protected]
>
> Hi Marius,
>>
>> yes is true that i like to have strong opinions and yes i could be
>>> wrong in most of them
>>> but when all the comunity screems at the namespace issue
>>>
>>
>> "All the community" is not screaming at the namespace issue. "A minority
>> of the community" is, but most of that minority would scream whatever we
>> did.
>>
>> an semisolution would be an php.ini variable
>>> like
>>> NAMSPACE_SEPARATOR="::"
>>>
>>
>> :-)
>>
>> Now go away and think really hard about what you wrote there, and you'll
>> maybe understand that smiley.
>>
>> - Steph
>>
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Vesselin Kenashkov
developer at
www.webstudiobulgaria.com
Kamil \"Brego\" Dzielinski
Re: [PHP-DEV] alpha2 scheduled
October 29, 2008 05:35PM
I really wish that this list was developer-only (which would mean i
couldn't write this post). The developers made a decision. And as much
as I dislike the "feel" of the '\' as namespace separator, the
argumentation for it is really solid - and it's a one character,
distinctive separator. Would you all really prefer to have to stand on
your head and make funny gestures instead? I wouldn't.

In the end the users of this language will do as they have always done
with new features. 20% will dislike the implementation, 20% will
outward not use it and 10% will misunderstand the benefits. But the
rest of use will do as usual - adapt, and be glad for a new, and
useful improvement.

So, as one of the people waiting for this feature for last 4 or 5
years, please, go with it, ignore the whiners, and make as all happy,
as you continue to do :)

Oh, and come out with that alpha as soon as possible, I'm so eager to
try this out :)

Thanks,
--
Kamil "Brego" Dzielinski: http://brego.dk/
Life is ours, we live it our way -- Metallica

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Stefan Walk
Re: [PHP-DEV] alpha2 scheduled
October 29, 2008 05:55PM
On Wednesday 29 October 2008 16:23:55 you wrote:
> Since this affects everybody, it should be opened up to the community, so,
> the internals should put together several options and then open a poll for
> the community to vote on and then use which ever comes out on top.

And the winner is ...
:never_gonna_give_you_up:

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Kelvin
Re: [PHP-DEV] alpha2 scheduled
October 30, 2008 12:55AM
personally I like ">>" but I'm pretty sure that wouldn't be possible ;)

"Stefan Walk" <[email protected]> wrote in message
news:[email protected]
> On Wednesday 29 October 2008 16:23:55 you wrote:
>> Since this affects everybody, it should be opened up to the community,
>> so,
>> the internals should put together several options and then open a poll
>> for
>> the community to vote on and then use which ever comes out on top.
>
> And the winner is ...
> :never_gonna_give_you_up:


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Sorry, only registered users may post in this forum.

Click here to login