Hi internals!
Since no new discussion topics appeared, the voting on the Group Use
Declarations RFC for PHP7 is now open:
RFC: https://wiki.php.net/rfc/group_use_declarations#votes
Patch: https://github.com/php/php-src/pull/1005
As requested I've split the vote into two slightly different syntax
choices, so be sure to pick the right choice if you are going to vote yes.
The voting will close in exactly 14 days counting from now.
PS: Aknowledgements to Daniel Ackroyd for reviewing this RFC.
Márcio Almada
https://github.com/marcioAlmada
Hi Marcio,
Hi internals!
Since no new discussion topics appeared, the voting on the Group Use
Declarations RFC for PHP7 is now open:RFC: https://wiki.php.net/rfc/group_use_declarations#votes
Patch: https://github.com/php/php-src/pull/1005
I like the idea (reducing the repeated namespace parts), but am not too
keen on the syntax.
If I may offer a hastily thought out, and probably terrible, idea... how
about something like "from prefix use ..." ?
To adapt an example from the RFC:
from Symfony\Component\Console\Question use
ConfirmationQuestion,
ChoiceQuestion as Choice,
OptionQuestion,
Question;
That's my two cents. Best of luck!
As requested I've split the vote into two slightly different syntax
choices, so be sure to pick the right choice if you are going to vote yes.
The voting will close in exactly 14 days counting from now.PS: Aknowledgements to Daniel Ackroyd for reviewing this RFC.
Márcio Almada
https://github.com/marcioAlmada
Hi Peter,
I like the idea (reducing the repeated namespace parts), but am not too
keen on the syntax.
If I may offer a hastily thought out, and probably terrible, idea... how
about something like "from prefix use ..." ? [...]
That's my two cents.
Some people suggested the "from ... *use *..." syntax similar to Python,
but this proposal would require the "from" keyword to be reserved. Also,
during research phase most people preferred the block syntax similar to the
trait conflict resolution syntax.
So, in resume the current proposal seems the most appropriate for PHP
because:
- It looks a lot like the already implemented traits conflict resolution
- It doesn't require to reserve new keywords
- It's a very readable choice
- During research phase it became clear that most people preferred it over
the alternatives (including your suggestion)
Best of luck!
Thank you!
Sincerely,
Márcio Almada
Hi Marcio,
Thanks for the RFC!
We discussed a little bit with the Hoa [1]'s and fruux [2]'s community
and we have a question. Why not pretending we have an array of symbols,
something like:
use Foo\Bar\[Baz, Qux];
instead of
use Foo\Bar\{Baz, Qux};
This is a list vs. block debate. While I personally would go for {
and
}
, here we declare a list, so we guess the array syntax would be more
tailored.
Thoughts?
[1] http://hoa-project.net/
[2] https://fruux.com/ and http://sabre.io/
Hi internals!
Since no new discussion topics appeared, the voting on the Group Use
Declarations RFC for PHP7 is now open:RFC: https://wiki.php.net/rfc/group_use_declarations#votes
Patch: https://github.com/php/php-src/pull/1005As requested I've split the vote into two slightly different syntax
choices, so be sure to pick the right choice if you are going to vote yes.
The voting will close in exactly 14 days counting from now.PS: Aknowledgements to Daniel Ackroyd for reviewing this RFC.
Márcio Almada
https://github.com/marcioAlmada
--
Ivan Enderlin
Developer of Hoa
http://hoa-project.net/
PhD. computer scientist
Hacker
http://mnt.io/
Thanks for the RFC!
We discussed a little bit with the Hoa [1]'s and fruux [2]'s community
and we have a question.
Why not pretending we have an array of symbols, something like:
use Foo\Bar[Baz, Qux];
instead of
use Foo\Bar{Baz, Qux};
This is a list vs. block debate. While I personally would go for
{
and
}
, here we declare a list, so we guess the array syntax
would be more tailored.
Thoughts?
Hi,
This is an interesting one. During research, the [
and ]
syntax was
considered for a while but it quickly felt apart for the following reasons:
- Most people considered on PHP the array construct is a very important
building block and therefore we should avoid to multiplex or reuse its
syntax in multiple contexts. This becomes more clear in cases involving
conflict resolutions:
use Foo\Bar[Baz as Buz, Qux\Quaz as Quiz];
- Block syntax seemed more versatile and prone to reuse because we already
have the traits conflict resolution syntax:
http://php.net/manual/en/language.oop5.traits.php#language.oop5.traits.conflict
The reasoning for using commas to delimit imported entities and not ;
is
that current use declaration syntax is a comma separated list:
use function foo\math\sin, foo\math\cos, foo\math\cosh;
Hence the {..., ...}
syntax seemed the most tailored to feel similar and
obvious for most of the current PHP userbase, based on all experiments:
use function foo\math{ sin, cos, cosh };
use function Foo\Bar{ A, B as Baz, C };
I hope that the given information is useful to your decision process. Good
voting!
Sincerely,
Márcio Almada.
Thanks for the RFC!
We discussed a little bit with the Hoa [1]'s and fruux [2]'s community
and we have a question.
Why not pretending we have an array of symbols, something like:
use Foo\Bar[Baz, Qux];
instead of
use Foo\Bar{Baz, Qux};
This is a list vs. block debate. While I personally would go for{
and
}
, here we declare a list, so we guess the array syntax
would be more tailored.
Thoughts?
Hi,
Hi :-),
This is an interesting one. During research, the
[
and]
syntax was
considered for a while but it quickly felt apart for the following reasons:
- Most people considered on PHP the array construct is a very important
building block and therefore we should avoid to multiplex or reuse its
syntax in multiple contexts. This becomes more clear in cases involving
conflict resolutions:use Foo\Bar[Baz as Buz, Qux\Quaz as Quiz];
+1.
- Block syntax seemed more versatile and prone to reuse because we already
have the traits conflict resolution syntax:http://php.net/manual/en/language.oop5.traits.php#language.oop5.traits.conflict
The reasoning for using commas to delimit imported entities and not
;
is
that current use declaration syntax is a comma separated list:use function foo\math\sin, foo\math\cos, foo\math\cosh;
Hence the
{..., ...}
syntax seemed the most tailored to feel similar and
obvious for most of the current PHP userbase, based on all experiments:use function foo\math{ sin, cos, cosh };
use function Foo\Bar{ A, B as Baz, C };I hope that the given information is useful to your decision process. Good
voting!
Yup sure. We are going to vote yes (behind my nickname).
However, while I agree with all your arguments, we have more syntax and
more semantics, it's kind of confusing :-/. But it's a small one, so +1
for us.
--
Ivan Enderlin
Developer of Hoa
http://hoa-project.net/
PhD. computer scientist
Hacker
http://mnt.io/
Yup sure. We are going to vote yes (behind my nickname).
However, while I agree with all your arguments, we have more syntax and
more semantics, it's kind of confusing.
But it's a small one,
so +1 for us.
I bet there is no way to add such a feature without adding at least a small
amount of syntax, and that's why I aimed for the minimal approach. Also,
there is no better time to have it added other than on a major version
release.
Thanks for your questions and your vote :)
Definitely +1 for me.
That what I proposed before. you make it happened ;-)
Yup sure. We are going to vote yes (behind my nickname).
However, while I agree with all your arguments, we have more syntax and
more semantics, it's kind of confusing.
But it's a small one,
so +1 for us.I bet there is no way to add such a feature without adding at least a small
amount of syntax, and that's why I aimed for the minimal approach. Also,
there is no better time to have it added other than on a major version
release.Thanks for your questions and your vote :)
--
Reeze Xia
http://reeze.cn
Hello Marcio,
I am inclined to vote no for a couple of reasons:
- This is not a BC-break, I would move the vote to PHP 7.1. The reasoning
behind this is that the tools in the ecosystem will have a lot of work to
get on par with PHP 7 (talking here about stuff like phpmd, phpcpd, phploc,
newrelic, codeclimate, ides, etc). Since this is not as resonant as the
other changes for 7, I would give those people some breathing room. - I am not a big fan of the syntax, I would much more like a python style
syntax (yes, I am aware it requires a new reserver keyword)
What are your thoughts on this?
Stelian
Definitely +1 for me.
That what I proposed before. you make it happened ;-)Yup sure. We are going to vote yes (behind my nickname).
However, while I agree with all your arguments, we have more syntax and
more semantics, it's kind of confusing.
But it's a small one,
so +1 for us.I bet there is no way to add such a feature without adding at least a
small
amount of syntax, and that's why I aimed for the minimal approach. Also,
there is no better time to have it added other than on a major version
release.Thanks for your questions and your vote :)
--
Reeze Xia
http://reeze.cn
Hi Stellan,
Hello Marcio,
I am inclined to vote no for a couple of reasons:
- This is not a BC-break, I would move the vote to PHP 7.1. The
reasoning behind this is that the tools in the ecosystem will have a lot
of work to get on par with PHP 7 (talking here about stuff like phpmd,
phpcpd, phploc, newrelic, codeclimate, ides, etc). Since this is
not as resonant as the other changes for 7, I would give those people
some breathing room.
Well, we already have new shiny features for PHP that would require
updates: for instance the return typehints and possibly the scalar type
hints. Any code analyzer that would like to stay relevant will need to
update anyway and perhaps updating these tools is much easier than you
think :) if you see the patch it's quite minimal and the syntax is easy to
parse.
I could compromise to send pull requests and update some of these tools (at
least the open source ones) in time for PHP7 release.
Other reasons to show you this is not a blocker and tailoring the RFC for
7.1 is not the best choice:
-
It will take a while until we see projects with PHP7 as a minimum
version requirements so if we want the feature it's a good idea to add it
to a major release. -
Feature freeze date is possibly March, 2015, possible release date is
Mid October 201. This means we will have plenty of time to update tooling.
This should not hold any language :)
- I am not a big fan of the syntax, I would much more like a python
style syntax (yes, I am aware it requires a new reserver keyword)
:) I have a hunch that a python copy syntax will not be proposed because of
the BC break you just mentioned ^
Other languages are using glob braces syntax and it simply works :) Perhaps
you could give it a chance. Many people reply to me saying that they
preferred python syntax but after a while they started to like the proposed
syntax too, for PHP.
This is a very basic feature and I strongly believe that, after all the
research and discussion, it's a good fit for PHP. Perhaps you might want to
read the discussion again before take your decision. See the previously
discarded options and the reasons why they were discarded. Maybe you might
end up agreeing that the current proposed syntax is a good choice.
Thanks for opening dialog and bringing legit questions before take a
decision. Good voting!
Sincerely,
Márcio Almada
On Fri, Feb 13, 2015 at 12:13 AM, Marcio Almada marcio.web2@gmail.com
wrote:
Hi Stellan,
Hello Marcio,
I am inclined to vote no for a couple of reasons:
- This is not a BC-break, I would move the vote to PHP 7.1. The
reasoning behind this is that the tools in the ecosystem will have a lot
of work to get on par with PHP 7 (talking here about stuff like phpmd,
phpcpd, phploc, newrelic, codeclimate, ides, etc). Since this is
not as resonant as the other changes for 7, I would give those people
some breathing room.Well, we already have new shiny features for PHP that would require
updates: for instance the return typehints and possibly the scalar type
hints. Any code analyzer that would like to stay relevant will need to
update anyway and perhaps updating these tools is much easier than you
think :) if you see the patch it's quite minimal and the syntax is easy to
parse.
I am not saying your RFC is the deal breaker, I am saying that the overall
effort grows.
I could compromise to send pull requests and update some of these tools (at
least the open source ones) in time for PHP7 release.
Print screen taken, will hold you to your words.
Other reasons to show you this is not a blocker and tailoring the RFC for
7.1 is not the best choice:
It will take a while until we see projects with PHP7 as a minimum
version requirements so if we want the feature it's a good idea to add it
to a major release.Feature freeze date is possibly March, 2015, possible release date is
Mid October 201. This means we will have plenty of time to update tooling.
This should not hold any language :)
- I am not a big fan of the syntax, I would much more like a python
style syntax (yes, I am aware it requires a new reserver keyword):) I have a hunch that a python copy syntax will not be proposed because of
the BC break you just mentioned ^Other languages are using glob braces syntax and it simply works :) Perhaps
you could give it a chance. Many people reply to me saying that they
preferred python syntax but after a while they started to like the proposed
syntax too, for PHP.
Will compile your PR and give it another try with a bit more open mind and
see how
it goes
This is a very basic feature and I strongly believe that, after all the
research and discussion, it's a good fit for PHP. Perhaps you might want to
read the discussion again before take your decision. See the previously
discarded options and the reasons why they were discarded. Maybe you might
end up agreeing that the current proposed syntax is a good choice.Thanks for opening dialog and bringing legit questions before take a
decision. Good voting!
Thanks for taking the time to read through and explain your angle.
Sincerely,
Márcio Almada
2015-02-12 20:55 GMT-03:00 Stelian Mocanita stelianm@php.net:
I could compromise to send pull requests and update some of these tools
(at
least the open source ones) in time for PHP7 release.Print screen taken, will hold you to your words.
Please do ;) If the RFC passes I'll be happy to pull request and help to
update the static analyzers for PHP7.
Other languages are using glob braces syntax and it simply works :) Perhaps
you could give it a chance. Many people reply to me saying that they
preferred python syntax but after a while they started to like the
proposed
syntax too, for PHP.Will compile your PR and give it another try with a bit more open mind and
see how
it goes
Thanks for taking the time to read through and explain your angle.
You're welcome,
Márcio Almada.
Hi internais,
This is just a friendly reminder that, according the the previously
established voting duration of 14 days, the voting for Group Use
declarations will close in exactly 17 hours counting from now.
Thanks.
Hi Marcio,
I send this because use of array operator has some popularities at least.
On Thu, Feb 12, 2015 at 11:25 PM, Marcio Almada marcio.web2@gmail.com
wrote:
Yup sure. We are going to vote yes (behind my nickname).
However, while I agree with all your arguments, we have more syntax and
more semantics, it's kind of confusing.
But it's a small one,
so +1 for us.I bet there is no way to add such a feature without adding at least a small
amount of syntax, and that's why I aimed for the minimal approach. Also,
there is no better time to have it added other than on a major version
release.
I think {} is better than [].
Using array operator for this seems a little strange to me.
I think this syntax is more like with block, not array.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net
Hi, Yasuo
I think {} is better than [].
Using array operator for this seems a little strange to me.
I think this syntax is more like with block, not array.Regards,
Thanks for supporting the sintax choice, we tried a plethora of
possibilities during research phase and "{" "}" seemed the only one that
blends perfectly with PHP. I'm sure that, if approved, it will be useful to
a majority of the PHP user base.
Good voting!
Regards,
Márcio Almada
I like use Foo\Bar(Baz, Qux);
Appreciate your time.
Netroby
2015-02-12 17:55 GMT+08:00 Ivan Enderlin @ Hoa ivan.enderlin@hoa-project.net:
Hi Marcio,
Thanks for the RFC!
We discussed a little bit with the Hoa [1]'s and fruux [2]'s community and
we have a question. Why not pretending we have an array of symbols,
something like:use Foo\Bar\[Baz, Qux];
instead of
use Foo\Bar\{Baz, Qux};
This is a list vs. block debate. While I personally would go for
{
and
}
, here we declare a list, so we guess the array syntax would be more
tailored.Thoughts?
[1] http://hoa-project.net/
[2] https://fruux.com/ and http://sabre.io/Hi internals!
Since no new discussion topics appeared, the voting on the Group Use
Declarations RFC for PHP7 is now open:RFC: https://wiki.php.net/rfc/group_use_declarations#votes
Patch: https://github.com/php/php-src/pull/1005As requested I've split the vote into two slightly different syntax
choices, so be sure to pick the right choice if you are going to vote yes.
The voting will close in exactly 14 days counting from now.PS: Aknowledgements to Daniel Ackroyd for reviewing this RFC.
Márcio Almada
https://github.com/marcioAlmada--
Ivan Enderlin
Developer of Hoa
http://hoa-project.net/PhD. computer scientist
Hacker
http://mnt.io/
For Human type experience, {} is harder than () to type, see your
keyboard, can you easier type {} or easier type ()
I hate {}
If you like to use {} as the group symbols, i would not like it.
It hurts my fingers.
Appreciate your time.
Netroby
2015-02-12 17:55 GMT+08:00 Ivan Enderlin @ Hoa ivan.enderlin@hoa-project.net:
Hi Marcio,
Thanks for the RFC!
We discussed a little bit with the Hoa [1]'s and fruux [2]'s community and
we have a question. Why not pretending we have an array of symbols,
something like:use Foo\Bar\[Baz, Qux];
instead of
use Foo\Bar\{Baz, Qux};
This is a list vs. block debate. While I personally would go for
{
and
}
, here we declare a list, so we guess the array syntax would be more
tailored.Thoughts?
[1] http://hoa-project.net/
[2] https://fruux.com/ and http://sabre.io/Hi internals!
Since no new discussion topics appeared, the voting on the Group Use
Declarations RFC for PHP7 is now open:RFC: https://wiki.php.net/rfc/group_use_declarations#votes
Patch: https://github.com/php/php-src/pull/1005As requested I've split the vote into two slightly different syntax
choices, so be sure to pick the right choice if you are going to vote yes.
The voting will close in exactly 14 days counting from now.PS: Aknowledgements to Daniel Ackroyd for reviewing this RFC.
Márcio Almada
https://github.com/marcioAlmada--
Ivan Enderlin
Developer of Hoa
http://hoa-project.net/PhD. computer scientist
Hacker
http://mnt.io/
Hi,
2015-02-13 1:33 GMT+01:00 Netroby hufeng1987@gmail.com:
For Human type experience, {} is harder than () to type, see your
keyboard, can you easier type {} or easier type ()
That depends on your keyboard and its configuration and might not be
true for the majority of php users.
I hate {}
If you like to use {} as the group symbols, i would not like it.
It hurts my fingers.
All block definitions in php use the {} syntax as do many other
languages. While the usage of the short array syntax would be
understandable () appears to be (in my personal opinion) out of line.
Thanks for your time
Hi,
I like use Foo\Bar(Baz, Qux);
For Human type experience, {} is harder than () to type, see your
keyboard, can you easier type {} or easier type ()
I hate {}
If you like to use {} as the group symbols, i would not like it.
It hurts my fingers.
Your suggested syntax was considered. But it ended up being discarded
during research phase because use Foo\Bar(Baz, Qux); looks too much like a
full qualified function call. That's not good for PHP. Maybe it's good for
Haskell but certainly not good for PHP.
No one here wants to hurt your little finger. Perhaps you should use a
Chinese keyboard with a better layout for programming? :)
Sincerely,
Márcio Almada
https://github.com/marcioAlmada
Hi,
For Human type experience, {} is harder than () to type, see your
keyboard, can you easier type {} or easier type ()I hate {}
If you like to use {} as the group symbols, i would not like it.
It hurts my fingers.
If you look at your keyboard, you'll also notice that double quotes
are harder to type than single ones. This is not a valid argument.
Cheers,
Andrey.
On Wed, Feb 11, 2015 at 9:50 PM, Marcio Almada marcio.web2@gmail.com
wrote:
Hi internals!
Since no new discussion topics appeared, the voting on the Group Use
Declarations RFC for PHP7 is now open:RFC: https://wiki.php.net/rfc/group_use_declarations#votes
Patch: https://github.com/php/php-src/pull/1005As requested I've split the vote into two slightly different syntax
choices, so be sure to pick the right choice if you are going to vote yes.
The voting will close in exactly 14 days counting from now.
I'm in favor of this RFC. Honestly I don't really understand the negativity
it is getting around here.
The ability to import multiple items from one namespace is a
well-established feature you'll find in many languages employing some kind
of namespacing. I don't think the availability of what I lovingly call "IDE
vomit" is a good reason to decline a feature - a programming language
should be able stand on its own and not require IDE assistance for
reasonable use.
The syntax seems pretty obvious as well - but maybe I just had too much
exposure to Rust, which makes extensive use of the same syntax.
Nikita
Hey,
I'm in favor of this RFC. Honestly I don't really understand the negativity
it is getting around here.The ability to import multiple items from one namespace is a
well-established feature you'll find in many languages employing some kind
of namespacing. I don't think the availability of what I lovingly call "IDE
vomit" is a good reason to decline a feature - a programming language
should be able stand on its own and not require IDE assistance for
reasonable use.The syntax seems pretty obvious as well - but maybe I just had too much
exposure to Rust, which makes extensive use of the same syntax.
My thoughts echo Nikita’s.
I think this feature would be especially important if PHP gets function autoloading (which it may yet gain in PHP 7 - a certain someone has been working on it). Currently, sets of independent functions have to be implemented as static classes. But with function autoloading, they’d have to be imported independently, and that would lead to way too many use statements.
This feature is familiar to people who have used other languages, as Nikita mentioned. In Python, I might do this:
from somelibrary.math import sin, cos, tan, degrees, radians
Simple, uncumbersome, readable.
The equivalent in PHP is this:
use function SomeLibrary\Math\sin;
use function SomeLibrary\Math\cos;
use function SomeLibrary\Math\tan;
use function SomeLibrary\Math\degrees;
use function SomeLibrary\Math\radius;
Ouch. Not fun to type, not fun to read, takes up way more space than it should. This is just a modest five functions, too - in many cases you’d be importing more.
But with Marcio’s proposal, we could instead write this:
use function SomeLibrary\Math\{sin, cos, tan, degrees, radius};
Much better, no? I know which one I’d rather read and write.
It’d be a real shame if this doesn’t pass.
--
Andrea Faulds
http://ajf.me/
But with Marcio’s proposal, we could instead write this:
use function SomeLibrary\Math\{sin, cos, tan, degrees, radius};
Well it used to be simply ...
require SomeLibrary\math.php;
--
Lester Caine - G8HFL
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
But with Marcio’s proposal, we could instead write this:
use function SomeLibrary\Math{sin, cos, tan, degrees, radius};
Well it used to be simply ...
require SomeLibrary\math.php;
I can’t say I miss the days of putting everything in the global namespace. Makes it impossible to use two libraries with conflicting function names.
Andrea Faulds
http://ajf.me/
But with Marcio’s proposal, we could instead write this:
use function SomeLibrary\Math{sin, cos, tan, degrees, radius};
Well it used to be simply ...
require SomeLibrary\math.php;
I can’t say I miss the days of putting everything in the global namespace. Makes it impossible to use two libraries with conflicting function names.
Well one fix would be to have all the namespace stuff in the math.php
file? All the use function stuff just loaded via the secondary file.
But the other way of looking at is 'why do we have so many different
libraries all doing the same thing?'
Currently database abstraction is a complete mess simply because there
is not now a standard way of doing things :( If you have to use two
libraries with conflicting names is that not because there are problems
with both libraries if you need to use both?
--
Lester Caine - G8HFL
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
Hi,
2015-02-13 18:37 GMT+01:00 Lester Caine lester@lsces.co.uk:
But with Marcio’s proposal, we could instead write this:
use function SomeLibrary\Math{sin, cos, tan, degrees, radius};
Well it used to be simply ...
require SomeLibrary\math.php;
I can’t say I miss the days of putting everything in the global namespace. Makes it impossible to use two libraries with conflicting function names.Well one fix would be to have all the namespace stuff in the math.php
file? All the use function stuff just loaded via the secondary file.
You would still need to import those functions into the current
namespace. Hence this rfc
I can’t say I miss the days of putting everything in the global namespace. Makes it impossible to use two libraries with conflicting function names.
Well one fix would be to have all the namespace stuff in the math.php
file? All the use function stuff just loaded via the secondary file.
You would still need to import those functions into the current
namespace. Hence this rfc
My point is "WHY" ... can't we simply import an include file which does
all the rest. As Pierre says, some of these are becoming totally
unwieldy, yet I can still include ADOdb and Smarty with two lines of
code in my start up ...
Just another example of where things have become hard work which now
needs additional fixes. Yes this RFC is probably needed, but isn't the
whole process wrong? Can't we restore the simple way of working in PHP7
where it does not need to wrap around other things quite so closely?
--
Lester Caine - G8HFL
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
Can't we restore the simple way of working in PHP7
where it does not need to wrap around other things quite so closely?
Hi Lester,
This way if doing things on php didn't go anywhere, people just stopped
using it because they saw better alternatives.
Can't we restore the simple way of working in PHP7
where it does not need to wrap around other things quite so closely?Hi Lester,
This way if doing things on php didn't go anywhere, people just stopped
using it because they saw better alternatives.
I could accept that statement if there was any actual evidence! The
problem today is not 'better alternatives' but rather the new bread of
developers who's interest is in the tools themselves rather than
actually using the results in practice. The split at the moment is one
of usability over language aesthetics. The very fact that 'you don't
have to use namespace or strict typing' means that for the majority of
users there is no need to change ... except the library developers are
continually moving the goal posts so that we HAVE to use some features,
or at least be up to speed on the third party use of those features
where we ARE reliant on third party libraries for many things.
The small stepping stones down a path that is NOT pulling everybody else
into the same vision is what is now threatening to blow PHP out of the
water. I do really feel that some things are going too far and need
their own 'space' along side PHP rather than being forced onto the rest
of use who simply want a stable language to work with. PHPNG is the sort
of improvement that was needed - speed. Even namespaces are not
essential to that target as simply adding a tag to any library function
is more than adequate, and even the fact that procedural functions seem
to be getting a little more respect shows that totally OO PHP is not yet
a user demand.
--
Lester Caine - G8HFL
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
Hi, Lester
Can't we restore the simple way of working in PHP7
where it does not need to wrap around other things quite so closely?
Hi Lester,
This way if doing things on php didn't go anywhere, people just stopped
using it because they saw better alternatives.I could accept that statement if there was any actual evidence! The
problem today is not 'better alternatives' but rather the new bread of
developers who's interest is in the tools themselves rather than
actually using the results in practice. The split at the moment is one
of usability over language aesthetics. The very fact that 'you don't
have to use namespace or strict typing' means that for the majority of
users there is no need to change ...
Perhaps you missed the point of this thread. We are not imposing anyone to
use namespaces (or scalar typehints), and neither discussing frivolous
aesthetic changes. This thread is about a functionality that could improve
PHP namespace and make function autoloading manageable on a not so distant
future. In fact, there are clear benefits for anyone using namespaces in
any context.
except the library developers are
continually moving the goal posts so that we HAVE to use some features,
or at least be up to speed on the third party use of those features
where we ARE reliant on third party libraries for many things.The small stepping stones down a path that is NOT pulling everybody else
into the same vision is what is now threatening to blow PHP out of the
water. I do really feel that some things are going too far and need
their own 'space' along side PHP rather than being forced onto the rest
of use who simply want a stable language to work with.
The proposed addition won't make the language less stable. You are probably
referring to something unrelated to this thread. Please keep the discussion
on topic.
Sincerely,
Márcio Almada
Hey,
I'm in favor of this RFC. Honestly I don't really understand the
negativity
it is getting around here.The ability to import multiple items from one namespace is a
well-established feature you'll find in many languages employing some
kind
of namespacing. I don't think the availability of what I lovingly call
"IDE
vomit" is a good reason to decline a feature - a programming language
should be able stand on its own and not require IDE assistance for
reasonable use.The syntax seems pretty obvious as well - but maybe I just had too much
exposure to Rust, which makes extensive use of the same syntax.My thoughts echo Nikita’s.
I think this feature would be especially important if PHP gets function
autoloading (which it may yet gain in PHP 7 - a certain someone has been
working on it). Currently, sets of independent functions have to be
implemented as static classes. But with function autoloading, they’d have
to be imported independently, and that would lead to way too many use
statements.This feature is familiar to people who have used other languages, as
Nikita mentioned. In Python, I might do this:from somelibrary.math import sin, cos, tan, degrees, radians
Simple, uncumbersome, readable.
The equivalent in PHP is this:
use function SomeLibrary\Math\sin; use function SomeLibrary\Math\cos; use function SomeLibrary\Math\tan; use function SomeLibrary\Math\degrees; use function SomeLibrary\Math\radius;
Ouch. Not fun to type, not fun to read, takes up way more space than it
should. This is just a modest five functions, too - in many cases you’d be
importing more.But with Marcio’s proposal, we could instead write this:
use function SomeLibrary\Math\{sin, cos, tan, degrees, radius};
Much better, no? I know which one I’d rather read and write.
It’d be a real shame if this doesn’t pass.
Fully agree here, with every said by Nikita and Andrea.
I feel again a gap between ppl using php, writing a lot of this code and
us. This is worrisome.
Cheers,
Pierre
Hi,
I think this feature would be especially important if PHP gets function
autoloading (which it may yet gain in PHP 7 - a certain someone has been
working on it).
If someone is working on function/constant autoloading, let me know, as I have a 100% BC RFC ready for this. I don't publish it only because, for 10 years, people around here have been shooting down everything that was not OO. And the last attempt from Anthony was a total failure.
I agree with Pierre about the gap between people using PHP and people with voting rights.
François
On Wed, Feb 11, 2015 at 9:50 PM, Marcio Almada marcio.web2@gmail.com
wrote:Hi internals!
Since no new discussion topics appeared, the voting on the Group Use
Declarations RFC for PHP7 is now open:RFC: https://wiki.php.net/rfc/group_use_declarations#votes
Patch: https://github.com/php/php-src/pull/1005As requested I've split the vote into two slightly different syntax
choices, so be sure to pick the right choice if you are going to vote yes.
The voting will close in exactly 14 days counting from now.I'm in favor of this RFC. Honestly I don't really understand the
negativity it is getting around here.The ability to import multiple items from one namespace is a
well-established feature you'll find in many languages employing some kind
of namespacing. I don't think the availability of what I lovingly call "IDE
vomit" is a good reason to decline a feature - a programming language
should be able stand on its own and not require IDE assistance for
reasonable use.The syntax seems pretty obvious as well - but maybe I just had too much
exposure to Rust, which makes extensive use of the same syntax.
I'd like to follow up with another point. I've seen multiple people claim
that code that requires so many "use"s that this proposal becomes relevant
violates the single responsibility principle, because it simply uses too
many different classes.
I don't think that this statement is correct and would like to provide an
example. The responsibility of the NameResolver class [1] from the
php-parser project is to resolve all names to be fully qualified where
possible (which sounds reasonably narrow to me). However in order to do
this it must consider a large number of different AST nodes, so that the
full import list (if you individually import every class, which is
customary in PHP) would look as follows:
use PhpParser\NodeVisitorAbstract;
use PhpParser\Error;
use PhpParser\Node;
use PhpParser\Node\Name;
use PhpParser\Node\Name\FullyQualified;
use PhpParser\Node\Stmt\Namespace_;
use PhpParser\Node\Stmt\Use_;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\Interface_;
use PhpParser\Node\Stmt\Trait_;
use PhpParser\Node\Stmt\Function_;
use PhpParser\Node\Stmt\Const_;
use PhpParser\Node\Stmt\Catch_;
use PhpParser\Node\Stmt\TraitUse;
use PhpParser\Node\Stmt\TraitUseAdaptation\Precedence;
use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\Expr\StaticPropertyFetch;
use PhpParser\Node\Expr\ClassConstFetch;
use PhpParser\Node\Expr\New_;
use PhpParser\Node\Expr\Instanceof_;
use PhpParser\Node\Expr\FuncCall;
use PhpParser\Node\Expr\ConstFetch;
Damn, this looks unwieldy. With this proposal it becomes:
use PhpParser{NodeVisitorAbstract, Error, Node};
use PhpParser\Node{Name, Name\FullyQualified};
use PhpParser\Node\Stmt{
Namespace_, Use_, Class_, Interface_, Trait_, Function_,
Const_, Catch_, TraitUse, TraitUseAdaptation\Precedence};
use PhpParser\Node\Expr{
StaticCall, StaticPropertyFetch, ClassConstFetch, New_,
Instanceof_, FuncCall, ConstFetch};
Which in my eyes is a much cleaner. There are simply some things that
require interacting with a lot of different classes - processing a syntax
tree is one of those.
Lastly I would also encourage everyone to see beyond the usual
object-oriented mindset. PHP is a multi-paradigm language and object- or
class-oriented code are not the end of the line. While, by convention, PHP
uses a 1-to-1 mapping for classes to files, this is not at all common for
functional and functional-ish code. If you write function-based libraries
you will define many functions in one file, which will again make use of
many other functions (which are preferably imported). As such you can end
up with many imports without any SRP violation.
Thanks,
Nikita
[1]
https://github.com/nikic/PHP-Parser/blob/master/lib/PhpParser/NodeVisitor/NameResolver.php
On Fri, Feb 13, 2015 at 5:24 PM, Nikita Popov nikita.ppv@gmail.com
wrote:I'd like to follow up with another point. I've seen multiple people claim
that code that requires so many "use"s that this proposal becomes relevant
violates the single responsibility principle, because it simply uses too
many different classes.I don't think that this statement is correct and would like to provide an
example. The responsibility of the NameResolver class [1] from the
php-parser project is to resolve all names to be fully qualified where
possible (which sounds reasonably narrow to me). However in order to do
this it must consider a large number of different AST nodes, so that the
full import list (if you individually import every class, which is
customary in PHP) would look as follows:use PhpParser\NodeVisitorAbstract;
use PhpParser\Error;
use PhpParser\Node;
use PhpParser\Node\Name;
use PhpParser\Node\Name\FullyQualified;
use PhpParser\Node\Stmt\Namespace_;
use PhpParser\Node\Stmt\Use_;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\Interface_;
use PhpParser\Node\Stmt\Trait_;
use PhpParser\Node\Stmt\Function_;
use PhpParser\Node\Stmt\Const_;
use PhpParser\Node\Stmt\Catch_;
use PhpParser\Node\Stmt\TraitUse;
use PhpParser\Node\Stmt\TraitUseAdaptation\Precedence;
use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\Expr\StaticPropertyFetch;
use PhpParser\Node\Expr\ClassConstFetch;
use PhpParser\Node\Expr\New_;
use PhpParser\Node\Expr\Instanceof_;
use PhpParser\Node\Expr\FuncCall;
use PhpParser\Node\Expr\ConstFetch;Damn, this looks unwieldy. With this proposal it becomes:
use PhpParser{NodeVisitorAbstract, Error, Node};
use PhpParser\Node{Name, Name\FullyQualified};
use PhpParser\Node\Stmt{
Namespace_, Use_, Class_, Interface_, Trait_, Function_,
Const_, Catch_, TraitUse, TraitUseAdaptation\Precedence};
use PhpParser\Node\Expr{
StaticCall, StaticPropertyFetch, ClassConstFetch, New_,
Instanceof_, FuncCall, ConstFetch};Which in my eyes is a much cleaner. There are simply some things that
require interacting with a lot of different classes - processing a syntax
tree is one of those.
You could very well argue that this is what relative syntax is for:
use PhpParser\NodeVisitorAbstract;
use PhpParser\Error;
use PhpParser\Node;
use PhpParser\Node\Stmt;
use PhpParser\Node\Expr;
then foo(Expr\New_ $expr)
That is even more readable and cleaner to read.
The same applies to importing many functions. For example in Go you can
only ever import namespaces (packages)
and they are always called with "namespace.Function", for example:
strings.Trim("foo")
Lastly I would also encourage everyone to see beyond the usual
object-oriented mindset. PHP is a multi-paradigm language and object- or
class-oriented code are not the end of the line. While, by convention, PHP
uses a 1-to-1 mapping for classes to files, this is not at all common for
functional and functional-ish code. If you write function-based libraries
you will define many functions in one file, which will again make use of
many other functions (which are preferably imported). As such you can end
up with many imports without any SRP violation.Thanks,
Nikita[1]
https://github.com/nikic/PHP-Parser/blob/master/lib/PhpParser/NodeVisitor/NameResolver.php
You could very well argue that this is what relative syntax is for:
use PhpParser\NodeVisitorAbstract;
use PhpParser\Error;
use PhpParser\Node;
use PhpParser\Node\Stmt;
use PhpParser\Node\Expr;then foo(Expr\New_ $expr)
That is even more readable and cleaner to read.
+1
The current namespace implementation is there to group code, which is
already does fairly successfully.
I have to wonder if it is PHPStorm, IDE's and the like that have
"encouraged" people to only use class names instead of a particular
part of a namespace (even if it is up to the last fragment of the
namespace name). That is a behavior I'd like to see curtailed in the PHP
community, b/c as Benjamin points out above, syntax that uses up to the
last NS fragment is far more succinct.
Question:
If curly braces are used to mimic block syntax, is the semicolon also
allowed? i.e:
use PhpParser:
NodeVisitorAbstract, Error, Node;
use PhpParser\Node:
Name, Name\FullyQualified;
use PhpParser\Node\Stmt:
Namespace_, Use_, Class_, Interface_, Trait_, Function_,
Const_, Catch_, TraitUse, TraitUseAdaptation\Precedence;
use PhpParser\Node\Expr:
StaticCall, StaticPropertyFetch, ClassConstFetch, New_,
Instanceof_, FuncCall, ConstFetch;
Is this something that should be considered?
-ralph
Hi, Ralph
The current namespace implementation is there to group code, which is
already does fairly successfully.
I have to wonder if it is PHPStorm, IDE's and the like that have
"encouraged" people to only use class names instead of a particular part
of a namespace (even if it is up to the last fragment of the namespace
name). That is a behavior I'd like to see curtailed in the PHP community,
b/c as Benjamin points out above, syntax that uses up to the last NS
fragment is far more succinct
Please, keep in mind we are not covering only the OOP paradigm. Remember
that functional programmers are a big part of the PHP user base and the
proposal has positive impacts on future proposals for function autoloading.
Please, refer to: https://wiki.php.net/rfc/group_use_declarations#rfc_impact
Question:
If curly braces are used to mimic block syntax, is the semicolon also
allowed? i.e:use PhpParser:
NodeVisitorAbstract, Error, Node;use PhpParser\Node:
Name, Name\FullyQualified;use PhpParser\Node\Stmt:
Namespace_, Use_, Class_, Interface_, Trait_, Function_,
Const_, Catch_, TraitUse, TraitUseAdaptation\Precedence;use PhpParser\Node\Expr:
StaticCall, StaticPropertyFetch, ClassConstFetch, New_,
Instanceof_, FuncCall, ConstFetch;Is this something that should be considered?
-ralph
--
This syntax was definitely not proposed neither on research or discussion
phase, therefore it's a new bit on the discussion :)
Despite it's aesthetically appealing at a first sight, I have some thoughts
upon it based on the same criteria used to propose the block syntax present
on the RFC:
-
We aimed for maximum readability. The block syntax delimited with
bracket{
...}
pairs is definitely easier to keep track in comparison
with a colon and semicolon:
...;
-
A block delimited by a double colon and a semicolon
:
;
is NOT yet
part of any structure from the PHP. Introducing a brand new element on the
syntax, when bracket delimited blocks{
...}
are already a pervasive
structure on the language, seems unnecessary, specially considering the
previous analysis on loss of readability. -
This idea also implies a distinct syntax for namespace fragments:
"PhpParser\Node\Stmt:" while least effort approach, that offers the least
cognitive effort to the user land, is to simply have namespace fragments
with a trailing "" as in "PhpParser\Node\Stmt". -
The paired brakets
{
...}
proposal stays on the comfort zone from
users already used to C-syntax language family. Introducing a colon and
semicolon to delimit a list in PHP would be new bits. I'd prefer to build
such a feature upon conservation of current PHP style.
These are the my thoughts around your suggestion in comparison with the
proposed syntax on the RFC. Perhaps you have something else to add? :)
Sincerely,
Márcio Almada
https://github.com/marcioAlmada
We aimed for maximum readability. The block syntax delimited with
bracket{
...}
pairs is definitely easier to keep track in
comparison with a colon and semicolon:
...;
A block delimited by a double colon and a semicolon
:
;
is NOT
yet part of any structure from the PHP. Introducing a brand new element
on the syntax, when bracket delimited blocks{
...}
are already a
pervasive structure on the language, seems unnecessary, specially
considering the previous analysis on loss of readability.
Almost all the most used control structures have an alternative way of
being delimited with a colon/semicolon blocking:
http://php.net/manual/en/control-structures.alternative-syntax.php
The difference is that what I proposed did not have an end-token, like
endforeach, endwhile, etc.
I think what you mean though is that the alternative syntax is not
pervasive in declaration structures, which is true.
This idea also implies a distinct syntax for namespace fragments:
"PhpParser\Node\Stmt:" while least effort approach, that offers the
least cognitive effort to the user land, is to simply have namespace
fragments with a trailing "" as in "PhpParser\Node\Stmt".The paired brakets
{
...}
proposal stays on the comfort zone
from users already used to C-syntax language family. Introducing a colon
and semicolon to delimit a list in PHP would be new bits. I'd prefer to
build such a feature upon conservation of current PHP style.These are the my thoughts around your suggestion in comparison with the
proposed syntax on the RFC. Perhaps you have something else to add? :)
The cognitive switch is going to have different impacts on different
people. While a nit-pick, I see { as an escape sequence (yes, I know
this was an argument with namespaces, but at least those always follow
with a letter) and causes a slight deficiency in readability for me, but
I realize it has been proposed to not have a \ at the end of the used name.
-ralph
Hi, Ralph
2015-02-14 12:43 GMT-03:00 Ralph Schindler ralph@ralphschindler.com:
- We aimed for maximum readability. The block syntax delimited with
bracket
{
...}
pairs is definitely easier to keep track in
comparison with a colon and semicolon:
...;
- A block delimited by a double colon and a semicolon
:
;
is NOT
yet part of any structure from the PHP. Introducing a brand new element
on the syntax, when bracket delimited blocks{
...}
are already a
pervasive structure on the language, seems unnecessary, specially
considering the previous analysis on loss of readability.Almost all the most used control structures have an alternative way of
being delimited with a colon/semicolon blocking:http://php.net/manual/en/control-structures.alternative-syntax.php
The difference is that what I proposed did not have an end-token, like
endforeach, endwhile, etc.I think what you mean though is that the alternative syntax is not
pervasive in declaration structures, which is true.
Ralph, you are right about point 2. I should have been more specific. BTW,
I still think it's weird not to have an end token on your suggestion. It
makes sense on it's own, but taking PHP as context the proposed syntax on
the RFC has more advantages.
- This idea also implies a distinct syntax for namespace fragments:
"PhpParser\Node\Stmt:" while least effort approach, that offers the
least cognitive effort to the user land, is to simply have namespace
fragments with a trailing "" as in "PhpParser\Node\Stmt".
- The paired brakets
{
...}
proposal stays on the comfort zone
from users already used to C-syntax language family. Introducing a colon
and semicolon to delimit a list in PHP would be new bits. I'd prefer to
build such a feature upon conservation of current PHP style.These are the my thoughts around your suggestion in comparison with the
proposed syntax on the RFC. Perhaps you have something else to add? :)The cognitive switch is going to have different impacts on different
people. While a nit-pick, I see { as an escape sequence (yes, I know this
was an argument with namespaces, but at least those always follow with a
letter) and causes a slight deficiency in readability for me, but I realize
it has been proposed to not have a \ at the end of the used name.
Yes, there is a voting option for not having a trailing "". FYI, if you
care enough to read the changelog, the very first draft used the no
trailing "" variant of the syntax. Turns out that many people pointed that
there is already a design convention to use a trailing namespace separator
before the glob braces on other languages. For instance, Rust language:
import a::b::{c, d, e, f}
Thanks,
Márcio Almada
-ralph
2015-02-13 13:50 GMT-03:00 Nikita Popov nikita.ppv@gmail.com:
On Fri, Feb 13, 2015 at 5:24 PM, Nikita Popov nikita.ppv@gmail.com
wrote:On Wed, Feb 11, 2015 at 9:50 PM, Marcio Almada marcio.web2@gmail.com
wrote:Hi internals!
Since no new discussion topics appeared, the voting on the Group Use
Declarations RFC for PHP7 is now open:RFC: https://wiki.php.net/rfc/group_use_declarations#votes
Patch: https://github.com/php/php-src/pull/1005As requested I've split the vote into two slightly different syntax
choices, so be sure to pick the right choice if you are going to vote
yes.
The voting will close in exactly 14 days counting from now.I'm in favor of this RFC. Honestly I don't really understand the
negativity it is getting around here.The ability to import multiple items from one namespace is a
well-established feature you'll find in many languages employing some kind
of namespacing. I don't think the availability of what I lovingly call "IDE
vomit" is a good reason to decline a feature - a programming language
should be able stand on its own and not require IDE assistance for
reasonable use.The syntax seems pretty obvious as well - but maybe I just had too much
exposure to Rust, which makes extensive use of the same syntax.I'd like to follow up with another point. I've seen multiple people claim
that code that requires so many "use"s that this proposal becomes relevant
violates the single responsibility principle, because it simply uses too
many different classes.I don't think that this statement is correct and would like to provide an
example. The responsibility of the NameResolver class [1] from the
php-parser project is to resolve all names to be fully qualified where
possible (which sounds reasonably narrow to me). However in order to do
this it must consider a large number of different AST nodes, so that the
full import list (if you individually import every class, which is
customary in PHP) would look as follows:use PhpParser\NodeVisitorAbstract;
use PhpParser\Error;
use PhpParser\Node;
use PhpParser\Node\Name;
use PhpParser\Node\Name\FullyQualified;
use PhpParser\Node\Stmt\Namespace_;
use PhpParser\Node\Stmt\Use_;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\Interface_;
use PhpParser\Node\Stmt\Trait_;
use PhpParser\Node\Stmt\Function_;
use PhpParser\Node\Stmt\Const_;
use PhpParser\Node\Stmt\Catch_;
use PhpParser\Node\Stmt\TraitUse;
use PhpParser\Node\Stmt\TraitUseAdaptation\Precedence;
use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\Expr\StaticPropertyFetch;
use PhpParser\Node\Expr\ClassConstFetch;
use PhpParser\Node\Expr\New_;
use PhpParser\Node\Expr\Instanceof_;
use PhpParser\Node\Expr\FuncCall;
use PhpParser\Node\Expr\ConstFetch;Damn, this looks unwieldy. With this proposal it becomes:
use PhpParser{NodeVisitorAbstract, Error, Node};
use PhpParser\Node{Name, Name\FullyQualified};
use PhpParser\Node\Stmt{
Namespace_, Use_, Class_, Interface_, Trait_, Function_,
Const_, Catch_, TraitUse, TraitUseAdaptation\Precedence};
use PhpParser\Node\Expr{
StaticCall, StaticPropertyFetch, ClassConstFetch, New_,
Instanceof_, FuncCall, ConstFetch};Which in my eyes is a much cleaner. There are simply some things that
require interacting with a lot of different classes - processing a syntax
tree is one of those.Lastly I would also encourage everyone to see beyond the usual
object-oriented mindset. PHP is a multi-paradigm language and object- or
class-oriented code are not the end of the line. While, by convention, PHP
uses a 1-to-1 mapping for classes to files, this is not at all common for
functional and functional-ish code. If you write function-based libraries
you will define many functions in one file, which will again make use of
many other functions (which are preferably imported). As such you can end
up with many imports without any SRP violation.Thanks,
Nikita[1]
https://github.com/nikic/PHP-Parser/blob/master/lib/PhpParser/NodeVisitor/NameResolver.php
That's a great use case NikiC, I couldn't give a better one. A link to this
email http://news.php.net/php.internals/82622 was added to the RFC.
Thanks,
Márcio
2015-02-13 13:50 GMT-03:00 Nikita Popov nikita.ppv@gmail.com:
use PhpParser\NodeVisitorAbstract;
use PhpParser\Error;
use PhpParser\Node;
use PhpParser\Node\Name;
use PhpParser\Node\Name\FullyQualified;
use PhpParser\Node\Stmt\Namespace_;
use PhpParser\Node\Stmt\Use_;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\Interface_;
use PhpParser\Node\Stmt\Trait_;
use PhpParser\Node\Stmt\Function_;
use PhpParser\Node\Stmt\Const_;
use PhpParser\Node\Stmt\Catch_;
use PhpParser\Node\Stmt\TraitUse;
use PhpParser\Node\Stmt\TraitUseAdaptation\Precedence;
use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\Expr\StaticPropertyFetch;
use PhpParser\Node\Expr\ClassConstFetch;
use PhpParser\Node\Expr\New_;
use PhpParser\Node\Expr\Instanceof_;
use PhpParser\Node\Expr\FuncCall;
use PhpParser\Node\Expr\ConstFetch;Damn, this looks unwieldy. With this proposal it becomes:
use PhpParser{NodeVisitorAbstract, Error, Node};
use PhpParser\Node{Name, Name\FullyQualified};
use PhpParser\Node\Stmt{
Namespace_, Use_, Class_, Interface_, Trait_, Function_,
Const_, Catch_, TraitUse, TraitUseAdaptation\Precedence};
use PhpParser\Node\Expr{
StaticCall, StaticPropertyFetch, ClassConstFetch, New_,
Instanceof_, FuncCall, ConstFetch};
It's only the former (existing) format which has benefits at all to me:
-
cognitively I can much easier glance through to "find" something.
Because my eyes just have to scan up/down on the same character column -
It's not alphabetically sorted (which just is important to "find"
things for a human, IMHO). No problem! Good text editors allow to sort a
selected text area alphabetically. Good look trying that with the group
syntax; this requires manual labor work or tooling. -
Markus
Hi Markus,
- cognitively I can much easier glance through to "find" something.
Because my eyes just have to scan up/down on the same character column
That's very subjective. Have you seen the use case regardless of patch
diffs on the RFC? Or the other examples given?
- It's not alphabetically sorted (which just is important to "find"
things for a human, IMHO). No problem! Good text editors allow to sort a
selected text area alphabetically. Good look trying that with the group
syntax; this requires manual labor work or tooling.
Interesting. But if you think it straight you will see that both proposed
syntax addition and current syntax will need tooling or manual labor to be
maintained in alphabetical order. Sorry, but this is not a real argument.
Sincerely,
Márcio Almada
- Markus
Le 11/02/2015 21:50, Marcio Almada a écrit :
Since no new discussion topics appeared, the voting on the Group Use
Declarations RFC for PHP7 is now open:
Hi,
We've discussed this RFC with other people of AFUP, and even though
there have been quite a few mails exchanged, I'm sorry to say we didn't
reach a consensus -- and, as such, are neither -1 nor +1.
Trying to summarize a few points:
- Some are worried about the impacts on visibility -- while other said
it would enhance it. - Some reported that their IDE deals with imports.
- But several also noted this syntactic sugar could be helpful.
In any case, those on the +1 side agree it should be with the trailing "".
Sorry this is probably not that helpful, and thanks for your work!
--
Pascal MARTIN, AFUP - French UG
http://php-internals.afup.org/
Hi
2015-02-25 8:45 GMT-03:00 Pascal MARTIN, AFUP mailing@pascal-martin.fr:
We've discussed this RFC with other people of AFUP, and even though there
have been quite a few mails exchanged, I'm sorry to say we didn't reach a
consensus -- and, as such, are neither -1 nor +1.Trying to summarize a few points:
- Some are worried about the impacts on visibility -- while other said it
would enhance it.- Some reported that their IDE deals with imports.
- But several also noted this syntactic sugar could be helpful.
In any case, those on the +1 side agree it should be with the trailing "".
Sorry this is probably not that helpful, and thanks for your work!
--
Pascal MARTIN, AFUP - French UG
http://php-internals.afup.org/--
Actually this is useful feedback. Thanks.
Hi,
The voting for Group Use Declarations is now closed with 39 "yes" and 19
"no" votes. According to the established 2/3 majority requirement, it
passed.
https://wiki.php.net/rfc/group_use_declarations#votes
If you voted "no": your feedback is still as important as before, specially
in case you think something needs to be improved in the future.
Thanks,
Márcio
Hi,
The voting for Group Use Declarations is now closed with 39 "yes" and 19
"no" votes. According to the established 2/3 majority requirement, it
passed.https://wiki.php.net/rfc/group_use_declarations#votes
If you voted "no": your feedback is still as important as before, specially
in case you think something needs to be improved in the future.Thanks,
Márcio
Congratulations sir.