Re: [PHP7] Remove the function keyword from class methods?
| From: | Ingwie Phoenix | Date: | Sat, 04 Oct 2014 22:27:25 +0000 |
| Subject: | Re: [PHP7] Remove the function keyword from class methods? | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-77785@lists.php.net to get a copy of this message | ||
Am 05.10.2014 um 00:10 schrieb Kris Craig <kris.craig@gmail.com>:
> On Oct 4, 2014 11:24 AM, "Thomas Gossmann" <mail@gossimaniac.net> wrote:
>>
>> Thanks Johannes, I slipped over it but would have never found the
> discussion to it.
>>
>> I run over it and the summary is: Many people like it and those that
> don't have brought arguments, that are present here again. The discussion
> is almost 4 years old by now, and people are complaining over things
> getting implemented in php back in time, which are now implemented and
> turned out to be ok - I expect the same to happen with this idea.
>> Main contra argument is, people are not able to grep for 'function *'
> anymore, which I guess is a minority of people and they can write
> themselves a shell-script which makes it possible to search for functions
> again, so not a big deal. However, the more important statement behind this
> is, who is the more important crowd of people that are targeted with
> changes like these? Primary or secondary consumers?
>> ... but see my other mail, which conatains answers.
>>
>> Though, I have one question left regarding the old rfc? Why it has been
> gone inactive and basically slept since then?
>>
>> Thanks
>> Thomas Gossmann
>>
>> Am 04.10.14 um 19:44 schrieb Johannes Schlüter:
>>
>>> On Fri, 2014-10-03 at 18:21 +0200, Thomas Gossmann wrote:
>>>>
>>>> I guess this was a discussion earlier, though I wasn't able to find
>>>> anything about it. Would love to hear, what pdt-internals (re-)think
>>>> about that topic.
>>>
>>>
>>> Go to wiki.php.net/rfc look at the titles containing "function" and you
>>> will see "Make T_FUNCTION in method declarations optional" which was
>>> added by me.
>>> https://wiki.php.net/rfc/optional-t-function
>>>
>>> Since proposing I was convinced this wasn't good. Please bring new
>>> arguments. Discussion was in this thread
>>> http://news.php.net/php.internals/50628 (another viewer
>>> might be better
>>> to find the ~64 followups)
>>>
>>> johannes
>>>
>>
>>
>> --
>> PHP Internals - PHP Runtime Development Mailing List
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
> Summary thus far:
>
> Pro: Eliminating the function keyword is good because coding ===
> sculpting; "perfection" occurs when there's nothing left to remove.
- The function keyword does not comply to the fact that its used on class methods.
- It’s a duplicate, when the parantheses already indicate a „function“.
>
> Con: It's completely unnecessary and would make it prohibitively difficult
> to consistently locate subroutine declarations in a codebase.
- People can no longer use a simple grep command to pick up functions.
- IDE’s will have to adapt to a longer search pattern.
>
> I believe the cons vastly outweigh the pros in this case. The function
> keyword is a very good example of PHP's KISS (Keep It Simple, Stupid)
> philosophy.
>
> But if you're serious about this, draft an RFC and we'll vote on it. If
> 2/3 support your idea, it'll pass.
>
> --Kris
Sorry, but if you summarize arguments, it’d be only fair to read back and actually name as many as
possible.
Not everybody can vote though, sadly. I still wish there was a way for non-devs to have a voice on
feature votes.
Kind regards, Ingwie.