Re: [RFC] Pipe Operator

From: Date: Tue, 03 May 2016 18:57:35 +0000
Subject: Re: [RFC] Pipe Operator
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to internals+get-93048@lists.php.net to get a copy of this message
On Tue, May 3, 2016 at 11:52 AM, Fleshgrinder <php@fleshgrinder.com> wrote: > On 5/3/2016 8:45 PM, Sara Golemon wrote: >> Pretending that poorly designed libraries exist is naîve. >> > I really do not know what you want to tell me with that first sentence. > Ooops, missed a negation when I typed it out. "Pretending that poorly designed libraries DON'T exist is naîve." > The solution for the problem is already baked into PHP and usable: > intermediate variables with meaningful names. Yes, this might sometimes > be overly verbose. Yes, this might tempt some people to create > meaningless variable names. All in all no argument that was brought up > so far showed that this kind of operator is really useful to solve > something that cannot be already solved. It is always just about source > code formatting and laziness to write out some variables. > As I've said already. Yes, intermediate variables do address this style of coding. Yes, this proposal is syntactic sugar. Intermediate variables also add cognitive overhead of their own in cataloging all the various intermediates used in a large function. By removing the explicit intermediate variables and replacing them with unnamed temporaries, the code becomes easier to read because there's less unnecessary assignments cluttering up the space. -Sara

« previous php.internals (#93048) next »