Newsgroups: php.internals
Path: news.php.net
Xref: news.php.net php.internals:88046
Return-Path: <peter.e.lind@gmail.com>
Mailing-List: contact internals-help@lists.php.net; run by ezmlm
Delivered-To: mailing list internals@lists.php.net
Received: (qmail 97807 invoked from network); 4 Sep 2015 08:00:43 -0000
Received: from unknown (HELO lists.php.net) (127.0.0.1)
  by localhost with SMTP; 4 Sep 2015 08:00:43 -0000
Authentication-Results: pb1.pair.com header.from=peter.e.lind@gmail.com; sender-id=pass
Authentication-Results: pb1.pair.com smtp.mail=peter.e.lind@gmail.com; spf=pass; sender-id=pass
Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.172 as permitted sender)
X-PHP-List-Original-Sender: peter.e.lind@gmail.com
X-Host-Fingerprint: 209.85.212.172 mail-wi0-f172.google.com  
Received: from [209.85.212.172] ([209.85.212.172:35562] helo=mail-wi0-f172.google.com)
	by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP
	id 53/B4-60419-AAF49E55 for <internals@lists.php.net>; Fri, 04 Sep 2015 04:00:42 -0400
Received: by wicge5 with SMTP id ge5so8782292wic.0
        for <internals@lists.php.net>; Fri, 04 Sep 2015 01:00:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:in-reply-to:references:from:date:message-id:subject:to
         :cc:content-type;
        bh=aKt5jRbRNcb5sc9GEJtZHmSu1MGuY5zwXFG3Xwyx8gc=;
        b=G3rWUVx8Ao+Pge8UZV3XsSxLTaGEAzNGWmnUlsYfG7j5tYRvMhGfhxmEj6auL2cYBB
         vgjVUSoPIF7lAHPJ131gFBX2PHD+A81lL1ZuMgxyayVRZQ0WvhzXvnIrjVvj2t5rlgGP
         IaYrEOu2/KPTKW0HeS3VATGPdHhc+WboRyAvSE52/JSHuw1WO0aGOSh08Vl9O4VN2soe
         kZ/PJsbPqnKoS2R+FOP1C2PL8LAVXB4he3PEpRHJgwdNiarkgWbqjSK34CFL6TCJ47mn
         TT0yKf0UoXNfsanTtxAk2ovR2UxtU90cBp6kkY8q1oaVKnmUBSa4GcQ+lyTSCG68N5Xu
         +a8Q==
X-Received: by 10.181.11.134 with SMTP id ei6mr4741756wid.83.1441353638424;
 Fri, 04 Sep 2015 01:00:38 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.28.176.200 with HTTP; Fri, 4 Sep 2015 01:00:18 -0700 (PDT)
In-Reply-To: <CAB6YZuwfGhh=EBJySNndtRjstpbvGxvHoWKV=5GUNrx8Prc1tA@mail.gmail.com>
References: <BLU436-SMTP13020F8CE8795C628BDC665E26B0@phx.gbl>
 <CAESVnVq9kBhK_uEH2-HvQN4Wv8DVSnwc9ukRjrQ0KNjUbaAD7g@mail.gmail.com>
 <55E77CA9.7050609@gmail.com> <CAB6YZux4uYG7u0XRc_56MWFo+8G_h_VZZbWhCDVqA7hdu5XSpg@mail.gmail.com>
 <55E81959.6040305@gmail.com> <CAB6YZuwimHWkh8ddvkagmXRQVCK-joUSmMYKKxxjx22BbktSRg@mail.gmail.com>
 <CAEU6NAdfF0w383CNF46B8-Ly2Me+nzwpDFUvjeR4ZHk3x1MoUQ@mail.gmail.com> <CAB6YZuwfGhh=EBJySNndtRjstpbvGxvHoWKV=5GUNrx8Prc1tA@mail.gmail.com>
Date: Fri, 4 Sep 2015 10:00:18 +0200
Message-ID: <CAEU6NAfF_jDy=cQdJzGNQ2a+AMiHc4JT6fTXcra8BoQUNyN1MA@mail.gmail.com>
To: =?UTF-8?Q?Pavel_Kou=C5=99il?= <pajousek@gmail.com>
Cc: Rowan Collins <rowan.collins@gmail.com>, PHP Internals <internals@lists.php.net>
Content-Type: multipart/alternative; boundary=f46d043bdf549d3780051ee74b54
Subject: Re: [PHP-DEV] [RFC] [Discussion] Short Closures
From: peter.e.lind@gmail.com (Peter Lind)

--f46d043bdf549d3780051ee74b54
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 4 September 2015 at 09:43, Pavel Kou=C5=99il <pajousek@gmail.com> wrote:

> On Fri, Sep 4, 2015 at 8:57 AM, Peter Lind <peter.e.lind@gmail.com> wrote=
:
> > On 4 September 2015 at 08:44, Pavel Kou=C5=99il <pajousek@gmail.com> wr=
ote:
> >
> > You're arguing that, subjectively, to you - parentheses make things
> harder
> > to read. For others they clarify things.
> > It should be obvious to everyone that this particular path of the
> discussion
> > has about as much merit as tabs vs spaces.
>
> Sure, it is subjective - but what isn't?
>
>
Consistency isn't.



> > That being the case, I would argue for consistency and simplicity. If y=
ou
> > need parentheses for other variants of this, require parentheses all th=
e
> way
> > through. It will be simpler to learn and trip fewer people up.
>
> Depends how you define simplicity. Because $a ~> $b ~> $c ~> $d is
> IMHO more simple than ($a) ~> ((($b) ~> (($c) ~> $d($foo))) - which is
> a result of the combination of amendments #2 and #3. I honestly do not
> know if I wrote the parenthesis right now or not (probably not),
> because there's simply just too many of them.
>
> Sure, parenthesis can help people understand things, but I'd say that
> at the same time, too many of them can be a problem as well (as the
> fun name for LISP - "lost in stupid parenthesis" - suggests).
>
>
Is it? And are the examples you make use of the only two options?
What about requiring parentheses around arguments, but not around the
function body? That would guard against stupid "I'll add another argument
... why isn't it working?!?!?!" errors (getting a syntax error and then
having to fix your code isn't easier than just consistently adding
parentheses around arguments).


> > Just think, if whoever constructed the if conditional hadnt thought "he=
y,
> > let's be clever and save some keystrokes by making the curlies optional
> in
> > some cases" we wouldn't have the multitude of bugs and security holes w=
e
> > know to exist, we wouldn't have to warn the young'uns against improper
> use
> > of if, we wouldn't have to write codesniffer rules against single line
> ifs,
> > etc, etc.
> >
> > Any argument to the effect of "let's be clever" or "it'll save some
> > keystrokes" is void. Period.
>
> This is not about saving characters, it's about not overcomplicating
> things.
>

You're aiming for the "let's be clever" camp, far as I can tell.




--=20
<hype>
WWW: plphp.dk / plind.dk
CV: careers.stackoverflow.com/peterlind
LinkedIn: plind
Twitter: kafe15
</hype>

--f46d043bdf549d3780051ee74b54--