Re: [RFC] Pipe Operator
| From: | Sara Golemon | Date: | Thu, 12 May 2016 17:02:24 +0000 |
| Subject: | Re: [RFC] Pipe Operator | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-93283@lists.php.net to get a copy of this message | ||
On Thu, May 12, 2016 at 5:48 AM, Zeev Suraski <zeev@zend.com> wrote:
> Whether it's $$ or !# or $0 or any other random symbol doesn't really matter.
>
Agreed.
> Here we have a completely optional syntactic sugar,
> that's not nearly as widely useful as OOP or namespaces.
>
Very few things will be as widely useful as OOP or namespaces, so that
comparison is a bit of a red herring. This construct is useful
anywhere function call nesting pushes you past a readability
threshold. That's not as ubiquitous as OOP as a whole, but it's
pretty widespread. As widespread as fluent call chaining, in fact.
> The question is whether the added complexity of a new operator,
> a new symbol and the new semantics around them both are
> worth the benefit of introducing them.
>
Agreed. There's a cost to every new token and parser rule on the
compiler side, and there's a cognitive overhead on the script
maintainer side as well. It seems we only disagree in the flexibility
provided by better syntax and the ease of using google,
stack-overflow, and php.net/manual.
> IMHO it's not.
>
And I'll expect you to vote accordingly. No hard feelings. :)
-Sara