Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110376 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 75816 invoked from network); 4 Jun 2020 18:37:09 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Jun 2020 18:37:09 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BDF3F1805EC for ; Thu, 4 Jun 2020 10:19:36 -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=-0.2 required=5.0 tests=BAYES_40,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-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-io1-f66.google.com (mail-io1-f66.google.com [209.85.166.66]) (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 ; Thu, 4 Jun 2020 10:19:36 -0700 (PDT) Received: by mail-io1-f66.google.com with SMTP id s18so7233385ioe.2 for ; Thu, 04 Jun 2020 10:19:36 -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; bh=Kc4wszgcGIBRJora5MpVbXN6qMcxs4ov62iWFJewzNc=; b=be4VfK+bihJ5dzIXz0kQE358eyVhTJVTxWfJMpDTcLuJIV8YXIeIwB4zGfFY9dnB8z 7bdcYfBXYrBfRQ8xneo3XTCHhgRpzxZaUxVxSVeEV7VMyryMR3gZ+lZI51Rky9tp1MwC cDAM6NB39YRKRJWPaF6B/7BqWrtc4SY48wbUR/zJj60PdBPvHzWC3ebya3Z53POFBaVe XCXnbr+WDHC3n6qczs8+5UVRGKB5oSCAKuuvgi1ryLuZ4+mdZJ+fstvr444noSMkTtlk F6Lv6OcKra0p15txI0hjOR+HjsXtttE6+qKCtEYD+Y6SQqymOf5hdI3zETG+A7dlZX7l v9ZQ== 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; bh=Kc4wszgcGIBRJora5MpVbXN6qMcxs4ov62iWFJewzNc=; b=mDfdIaES8Vr4GJdoMiOT5sCUYcGmpOg6fG1GoLKpriuX4NISRerL0R6F5KQcV425AC NNe5GyVj49hJxjokRRTXCSPiKHu+Gb3mZZiSlmzp0ox3+tAb4NjYhYZMvRTLMZfEK/z5 C4LOedNbJFrxVVmZFqwbYtjQahUFeaM3qF1HbrnPUHP6iNrEynMAuQIp7O7O5z3DsnBA xQSId2+al6beVdYIQe1IKlgSYpKphlg/PxVbsalfUoH3k1nO5CgEK4yrwPHQltHsUAYF Q20y5BTfJG8xzjMAvYaCwIjvWhl5i5US3PTzaHByezppPDTUNOi9qrFezvcejJpc8aAc 96lw== X-Gm-Message-State: AOAM531FXNnXyJrcRHz7bROOHk4x91j5BamBnMGU8Un2wFfpoi01hNVz lrBZ9hV2PD4G4VV3jJR16cKm8qq2+vZUML1t+32amw== X-Google-Smtp-Source: ABdhPJzzLvDq0nTaPmO4dka0sS/K4JUk1IdY48lFslRPDYwwaaFOBIS5/Fv1xIQPK/c27hB8V4cxDEXB/XPnApYM05M= X-Received: by 2002:a6b:e60e:: with SMTP id g14mr4920482ioh.141.1591291175689; Thu, 04 Jun 2020 10:19:35 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 4 Jun 2020 18:19:23 +0100 Message-ID: To: internals Content-Type: multipart/alternative; boundary="00000000000042e21c05a7455909" Subject: Re: [PHP-DEV] [RFC] Shorter attribute syntax From: rowan.collins@gmail.com (Rowan Tommins) --00000000000042e21c05a7455909 Content-Type: text/plain; charset="UTF-8" On Thu, 4 Jun 2020 at 00:55, Theodore Brown wrote: > https://wiki.php.net/rfc/shorter_attribute_syntax > > The goal is not to bikeshed over subjective syntax preferences, > but to address several concrete shortcomings related to verbosity, > nested attributes, confusion with generics and other tokens, and > dissimilarity to other common languages. > Hi Theodore, I find the "objective" reasons in this RFC to be greatly exaggerated. 1. "@@Jit" does not require "half as many characters" as "<>"; even for this, which is probably the shortest attribute anyone will ever use, the saving is less than 30%; for more common attributes which resemble entire function calls, it will be a tiny proportional saving. 2. You don't actually explain why @@Foo would be any easier to integrate with nested attributes than <>. Is there some parser conflict that applies to one and not the other? 3. While confusion with generics is possible, I would be interested to hear from C# programmers how often they confuse [Attribute] for an array index operation, or any of the other uses of square brackets. 4. Similarly, I've yet to see anyone point to an example of confusion with shift operators that's not extremely contrived. I could come up with equally contrived examples where an attribute contained e-mail addresses and twitter handles, making @@ look confusing. 5. No other language has been put forward using the @@ operator. It more closely resembles those languages that use a single @, but the <> syntax more closely resembles those languages that use some form of brackets. I also find it disingenuous that you refer to the <> syntax as "the shift tokens" throughout, but do not similarly call your proposed syntax "the double-suppression token". If one is "double-at", then the other is "double-angle-brackets". The one convincing *objective* argument I've seen is Jordi's, that @@ would be easily greppable. Interestingly, that's not true of any of the other languages listed in the comparison other than Rust's hash-bracket and maybe C++'s double-bracket, but that doesn't mean we can't do better. Other than that, I think it really comes down to a matter of taste. Some people reacted to the <> syntax the way they did to the Cats movie trailer, and may react to this one better. That's fine; we can make a decision for subjective reasons, but let's be honest and say that. Regards, -- Rowan Tommins [IMSoP] --00000000000042e21c05a7455909--