Re: [RFC] Pipe Operator
| From: | Sara Golemon | Date: | Mon, 09 May 2016 06:27:28 +0000 |
| Subject: | Re: [RFC] Pipe Operator | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-93122@lists.php.net to get a copy of this message | ||
On Sun, May 8, 2016 at 10:37 PM, Stanislav Malyshev <smalyshev@gmail.com> wrote:
> I don't see how it helps anything. It just replaces clear variable names
> with cryptic sequences of characters with no intuitive meaning and magic
> semantics invented solely to save a few keystrokes.
>
Yep, that's exactly what "->" does. It's just pointless syntactic
sugar for hiding "$obj" when calling functions which happen to take an
instance as their magicly passed argument.
Oh, sorry, we were talking about the function version of ->, my
mistake. That's a totally different thing.
> Moreover, it would
> only in one sole use case where functions always return a value that is
> immediately passed to the next one and is sole argument for it,
>
Hrmmm... Did you read the RFC? It's pretty clear that the lhs
expression can be used in a lot more cases that function calls and
that it needn't be the only argument. Better read it again.
> Quite the opposite. It has completely unobvious syntax (what is $$? What
> is the value of $$? how I see this value if I need to debug this code?)
> and does not allow to do anything but making code more cryptic.
>
That's a great reason for voting against short ternary syntax. What
the hell is "?:", anyway?
-Sara