Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111437 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 75504 invoked from network); 10 Aug 2020 15:03:12 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Aug 2020 15:03:12 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 201EC180511 for ; Mon, 10 Aug 2020 07:02:23 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 10 Aug 2020 07:02:22 -0700 (PDT) Received: by mail-lj1-f177.google.com with SMTP id v12so9671123ljc.10 for ; Mon, 10 Aug 2020 07:02:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7yyBmxGTo/7dNjOr9qG7GgOcxSfPkwOPb0KDsKOIgd0=; b=i+9vFzQ7yrkTJ3zMt3sb75nBI7i5xMDA/rKAKHpSMa3iwhX+7kVWrlYrrv11lKP2yV CXYwW3Fbu6TkywlwrbSmSUlDGHpiwVHGhflo23naV/0goxP4A5Y+WgOpaqONLp1ra+6Q QTfv0IhB1prxCfSrya6VS79bmV4moBV85GonSLXZwg+NVf4r3PBjMzomtGq9x4LTiGJi L4DLZzssMNV0nRbnQnNImjrhQSYXTXiQLg5e9InAQRI6zfxgM++zu8NwMu8tu3XMkjRU uU4UzJFf0Od0S/G0Sw6vXZc531OQW1rcEg0OCE2XlzjL92dBS5LorKI5mnuC4s5q93Yt RCCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7yyBmxGTo/7dNjOr9qG7GgOcxSfPkwOPb0KDsKOIgd0=; b=U+dMKxHTUXu0IBjSHXjyCh+Ntr2eNQF2W5ghDCXF6cZGBeTdNe9KgD3Gy0aL9g/Kfv uOH/kaSS3FeOOHag860J7lSnhV0N3lc2Bu6/BI5NcL9sAVPWjUKzkz5NLdZKUS+Jbwm0 PMfdYCSWhGor2mIONyso6C1OgS6ZED4CedW3GGAmhqABuB6hmwp3s5ns5TXocy8VMEzd 2jxceobIu7s/gmRx0BVX7beom6fbeV64hWVyClBUnEzEgBov5qiMzD7ktunJLxbUZqsA p2MvVykI+zvkFB4GfQEojZWQsvS9l1XzFufHjS6Oo5qs7eetNglsAY/jorARQs9G7Xwt 0FvA== X-Gm-Message-State: AOAM533UynnJVSnHvRp8eLGXBSHHpZLnQVvnLzVv73wwnPwde6FbUPTx 0ikbKs8hrGhI03pQFTeAy14Uhd+CexddMuZ2aQk= X-Google-Smtp-Source: ABdhPJy9ADtEsVpz8BbfnR3ousgSiGI5GN2V1F4MTmnXvLIVYWFzEuDZv1fyUISV8Osxsl/fPb6oc73Py5PsOy+q0vM= X-Received: by 2002:a2e:1417:: with SMTP id u23mr740959ljd.44.1597068141099; Mon, 10 Aug 2020 07:02:21 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 10 Aug 2020 17:02:08 +0300 Message-ID: To: Theodore Brown Cc: Derick Rethans , PHP Developers Mailing List Content-Type: multipart/alternative; boundary="0000000000003b7d5505ac866786" Subject: Re: [PHP-DEV] [VOTE] Shorter Attribute Syntax Change From: benas.molis.iml@gmail.com (Benas IML) --0000000000003b7d5505ac866786 Content-Type: text/plain; charset="UTF-8" On Mon, Aug 10, 2020, 4:28 PM Theodore Brown wrote: > On Mon, Aug 10, 2020 at 3:41 AM Derick Rethans wrote: > > > I've just opened the vote to make sure we don't make a terrible mistake > > with using the @@ syntax for attributes: > > > > https://wiki.php.net/rfc/shorter_attribute_syntax_change#voting > > > > The first vote is a vote to say that you have an opinion about attribute > > syntax. Make sure to read up on the discussion on the mailinglist if you > > haven't done so yet. > > I voted "No", as the primary premise for this RFC is fundamentally flawed: > > > The main concern is that @@ has no ending symbol and it's inconsistent > > with the language that it would be the only declaration or statement > > in the whole language that has no ending termination symbol. > > As I pointed out in the discussion thread, this simply is not the case. > Attributes are not standalone declarations or statements, but modifiers > that always come before a declaration and add metadata to it. This > is consistent with visibility modifiers and type declarations (which > are not necessarily a single word): > > # declaration modifiers do not have end/grouping symbols like this > @[MyAttr([1, 2])] > [public] function foo(@[Deprecated] [int|float] $bar) {} > > # this is more consistent: > > @@MyAttr([1, 2]) > public function foo(@@Deprecated int|float $bar) {} > > > The second vote is an STV vote. > > > > In STV you SHOULD rank *all* choices, but don't pick the same one more > > than once, as that will invalidate your vote. > > > > Please have a objective look at the table > > (https://wiki.php.net/rfc/shorter_attribute_syntax_change#proposal) and > > don't just go by asthetics. > > I find this table to be unfortunately incomplete. E.g. why doesn't it > bold the number of required characters for @@, since this is one of > its advantages? And IMO there's literally no advantage in typing one less character. Because if there is, let's also shorten all of our function names i. e. `strlen` to `sl` and `gettype` to `gt`. why is "Allows Grouping" marked as an advantage > for the other three syntaxes? Grouping adds implementation complexity, > leads to unnecessary diff noise, and is rarely more concise than @@ in > real-world use cases. > I'd like to remind other internals that there is no "added complexity" (unless someone is unable to understand 20 lines of code) and it's misleading to say otherwise. > I also find it concerning that the RFC doesn't have an example for each > consideration showing how one syntax addresses it better than another. > For example, the Shorter Attribute Syntax RFC showed potential nested > attributes and how @@ would support them more cleanly, but this RFC > fails to mention them anywhere. Syntax choice DOES NOT affect how "cleanly" we can support nested attributes. AFAIK simple recursion would allow to implement those with any attribute syntax with exactly the same code. > Finally, while the table mentions that each syntax other than <<>> has > a BC break, I think it's just as important to consider the *size* of > the breaking change. #[] and @[] are larger BC breaks than @@ since > they break useful syntax: > > // with #[] > #[x] code like this would break > $val = ['new value']; #['old value']; > > // with @[] > $x = @[foo(), bar()]; // this code would break > > Both of these are useful patterns, and I'm not convinced that breaking > them is justified. Shouldn't there be a Backward Incompatible Changes > section in the RFC with these examples? > > Best regards, > Theodore > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > --0000000000003b7d5505ac866786--