Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92968 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66742 invoked from network); 30 Apr 2016 00:20:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Apr 2016 00:20:01 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.173 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.173 mail-pf0-f173.google.com Received: from [209.85.192.173] ([209.85.192.173:35528] helo=mail-pf0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BE/81-58459-E2AF3275 for ; Fri, 29 Apr 2016 20:19:59 -0400 Received: by mail-pf0-f173.google.com with SMTP id 77so21840416pfv.2 for ; Fri, 29 Apr 2016 17:19:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=rWPP0H2jouZSgMa6pU0PO0+9uAlvQZnENBQhjdNCtUA=; b=ds88/LkBkWOpdFsCBEuARXLedp4LpfMrHTjPpMQM/OhSTAUbo22lig871zElVps2+W GCkgAYeMKJnFjXI/Ta2Z7twl4lNtBLEZKorjvX1ZCkxbAVIXBKvK5OAwZyBP57krGSxd xhZbpaA8ZVmGT/24skjLraDzP0gnUeudoFMnSie92zJ6mFsAlWFrFUhnsmyK2mCRJSHy RyQ6yXdYyEozieRheqEkeWFv1YradeFIKPGxG7TeI/UTAtr/LoFJgnnlUgme1f0vlgVc MYlSDUCxsIv0jvV2Fufe4Zg4mcRHILdMStcnRyopdEROt1yWShJJO5/KX1jeU0utOi5G 4SIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=rWPP0H2jouZSgMa6pU0PO0+9uAlvQZnENBQhjdNCtUA=; b=azqW2QVBAamQPXd02jAdLFXcXqEEPb+v9cGfg0Mh+a4rY04SybmLQFPM37gfxPdovj vOPtQ6z4Jxi26pgwss5wndYkHvrgyKtQtdQKdXqRS+QfhfIrhOiUphJ/+41i2Z8niMnS zz+bBf+VKT3+9+HiOSFsOwQQfDTwIkvXpQJvq5PQlrYcj2hiUHJ1vzUQC59VJF2CB1sL B5eVeh5FPfHzOYS7kOp9n+LNOUTr8dpAoqTMg8tXH0EKmz6jPIK5QrP//kJpmRg8aOCy NxAvDsR9fIxSbxnsHe+aJk+J9MGJLHwUBZC+newzMyf2LoYkHZViqZBOQp7/2WzlbAu2 E+xw== X-Gm-Message-State: AOPr4FWfMLDoCz+3q6NYep85OfkhSjnUVG/6NVPcXlfqO0fq5o6SysLOcdEOkkPrGGRoWA== X-Received: by 10.98.2.16 with SMTP id 16mr33310139pfc.148.1461975595660; Fri, 29 Apr 2016 17:19:55 -0700 (PDT) Received: from Stas-Air.local (76-220-46-95.lightspeed.sntcca.sbcglobal.net. [76.220.46.95]) by smtp.gmail.com with ESMTPSA id x64sm26320241pfx.95.2016.04.29.17.19.53 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 29 Apr 2016 17:19:54 -0700 (PDT) To: Sara Golemon , PHP internals References: Message-ID: <8ea990da-1fe7-256c-4e08-0b30715c8e8a@gmail.com> Date: Fri, 29 Apr 2016 17:19:51 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Pipe Operator From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > This is one of my favorites out of HackLang. It's pure syntactic > sugar, but it goes a long way towards improving readability. > https://wiki.php.net/rfc/pipe-operator I think this takes the syntax too much towards Perl 6 direction. There is a lot of fun in inventing cool signs like |> and making them do nontrivial cool stuff. There's much less fun when you try to figure out what such code is actually doing - and especially why it is not doing what you thought it is doing. Brian Kernigan once said: "Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?" I think this applies not only to debugging, but also to reading programs in general. If we are "as clever as we can be" with syntax, the program becomes unreadable. For this feature specifically, I see nothing wrong with assigning intermediate results to variables - moreover, I see an advantage to it both in reading (you tell people what you expect to have happened in this stage) and in debugging (you can actually *see* what happened and *check* whether what you thought should be happening actually happened). If we could achieve the elegance of Unix pipes, I'd agree that it is simple enough that we can see what is going on - but having it rely on two magic things which are in different part of expression and context-dependent ($$ means different things in different places) is too much for me. -- Stas Malyshev smalyshev@gmail.com