Hi,
I have a suggestion, maybe many gave it before.
My suggestion is the optional use of the keyword "function" inside classes,
interfaces and traits.
It would look much more clean while removing the redundancy.
Cheers,
Mathias Grimm
Hi Mathias
2016-08-29 15:03 GMT+02:00 Mathias Grimm mathiasgrimm@gmail.com:
Hi,
I have a suggestion, maybe many gave it before.My suggestion is the optional use of the keyword "function" inside classes,
interfaces and traits.
It would look much more clean while removing the redundancy.
This was discussed on internals 2 years ago, back when PHP7 was being designed:
http://marc.info/?t=141235344900003&r=1&w=2
--
regards,
Kalle Sommer Nielsen
kalle@php.net
Hi, Thanks
Seems like is not going to happen very soon :)
In fact it is not broken, it's only a cosmetic nice to have.
Maybe in the future it will happen.
Hi Mathias
2016-08-29 15:03 GMT+02:00 Mathias Grimm mathiasgrimm@gmail.com:
Hi,
I have a suggestion, maybe many gave it before.My suggestion is the optional use of the keyword "function" inside
classes,
interfaces and traits.
It would look much more clean while removing the redundancy.This was discussed on internals 2 years ago, back when PHP7 was being
designed:
http://marc.info/?t=141235344900003&r=1&w=2--
regards,Kalle Sommer Nielsen
kalle@php.net
As was said, this was debated a lot. Both sides had valid arguments, but
this should not be taken lightly just because there is no "BC break". There
is such thing as too much syntactic sugar, and PHP is one of those, rare
these days, languages that keep options of doing the same thing low.
Hi, Thanks
Seems like is not going to happen very soon :)In fact it is not broken, it's only a cosmetic nice to have.
Maybe in the future it will happen.Hi Mathias
2016-08-29 15:03 GMT+02:00 Mathias Grimm mathiasgrimm@gmail.com:
Hi,
I have a suggestion, maybe many gave it before.My suggestion is the optional use of the keyword "function" inside
classes,
interfaces and traits.
It would look much more clean while removing the redundancy.This was discussed on internals 2 years ago, back when PHP7 was being
designed:
http://marc.info/?t=141235344900003&r=1&w=2--
regards,Kalle Sommer Nielsen
kalle@php.net
On Mon, Aug 29, 2016 at 10:22 PM, Arvids Godjuks
arvids.godjuks@gmail.com wrote:
As was said, this was debated a lot. Both sides had valid arguments, but
this should not be taken lightly just because there is no "BC break". There
is such thing as too much syntactic sugar, and PHP is one of those, rare
these days, languages that keep options of doing the same thing low.
I remember an argument that "function" is useful to "grep functions".
This is true, but we have tokenizer and tokenizer does better job.
e.g. It excludes functions inside comments.
It may be time to consider simplifying things.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net
I remember an argument that "function" is useful to "grep functions".
This is true, but we have tokenizer and tokenizer does better job.
e.g. It excludes functions inside comments.It may be time to consider simplifying things.
Perhaps, but I would typically be doing something like this when I’ve opened a PHP file in a basic text editor and am trying to find where a function is declared rather than used. The tokenizer is of no help in this use-case. Plus, I happen to like having a consistent item to lock onto visually — always hated missing that in languages that don’t have it. (For the same reason, I much prefer the function’s return type at the end rather than at the beginning of the line.)
--
Bob Williams
On Thu, Sep 1, 2016 at 3:06 AM, Robert Williams rewilliams@newtekone.com
wrote:
I remember an argument that "function" is useful to "grep functions".
This is true, but we have tokenizer and tokenizer does better job.
e.g. It excludes functions inside comments.It may be time to consider simplifying things.
Perhaps, but I would typically be doing something like this when I’ve
opened a PHP file in a basic text editor and am trying to find where a
function is declared rather than used. The tokenizer is of no help in this
use-case. Plus, I happen to like having a consistent item to lock onto
visually — always hated missing that in languages that don’t have it. (For
the same reason, I much prefer the function’s return type at the end rather
than at the beginning of the line.)--
Bob Williams
Yeah, and I would question:
- why are you editing with a plaintext editor and searching stuff like
that? Are you in a super-hurry? Seems like a 0.001% scenario - why do you need to search for functions in a class? Just what kind of
monstrous abomination are you working on?
Marco Pivetta
Yeah, and I would question:
- why are you editing with a plaintext editor and searching stuff like
that? Are you in a super-hurry? Seems like a 0.001% scenario- why do you need to search for functions in a class? Just what kind of
monstrous abomination are you working on?
I think this conversation is going nowhere. We can equally ask
hypothetical questions the other way:
- Why do you find the word "function" so hard to type? Are you in a
super-hurry? - Why are your function declarations so long that you need to save 8
characters? What kind of abomination are you working on?
etc
etc
There really isn't that much to say either way: some people like having
the keyword introduce each declaration, some people don't. Can we just
agree that it's a matter of style?
If we were designing a new language, we could vote on what consistent
style we wanted to create. With 20 years of existing language history,
there's always going to be a bias towards keeping things as they are.
Regards,
Rowan Collins
[IMSoP]