Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111246 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 90342 invoked from network); 29 Jul 2020 11:48:45 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 Jul 2020 11:48:45 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 185B8180532 for ; Wed, 29 Jul 2020 03:44:54 -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, 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-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) (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 ; Wed, 29 Jul 2020 03:44:53 -0700 (PDT) Received: by mail-wr1-f68.google.com with SMTP id r12so21109941wrj.13 for ; Wed, 29 Jul 2020 03:44:53 -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=FAR+AtqPuVVGEDx8tI16wGm6RGXBwtjwR15LQViAISI=; b=ZbULuhgIxoEacE+siq0aAmYm68Jg7oBHD4HsJg/Mv2DjlrBq2boSuOl6RJuUnxkHjp clVVwSCCgyvY/FXTSRAMpllFncSbuB5+LrUuqj51YEDbp+Sv6+M1yKCdjyZhJ5i/dL2Q sSnT0E4h1SaoM5hubsqRRIye9GE+3f3vjwl3kp20ZD7VEEiu0OgzZTd+jhAh7NElqQIB popggMZhjhPyDQFfgy0fiitkGWKv2taNDfw6VMwN3Phj3FU5LQk6PUSyrPBG344+NjkJ MXBM6kzRS6IWI9PIwey5elmeAJJSvA3hsnLVeRRFDOfPfkqT1ZBqzp0wlu6IAQfV814i 9ffg== 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=FAR+AtqPuVVGEDx8tI16wGm6RGXBwtjwR15LQViAISI=; b=h7snI8suNBtWOmivLxhT3uVQdjWWbR6WOGLKl0x96hy1WPQ8MjgFqvjMh8ZeFBqoMP HQ+A7/OYSSgmc/kF688NX0eq5gZal6tGTYGkVuFkVOZ9HIzJIXWY5A5BL4YWNhFiiX2R KvW4hkUF9dNkv8p//y8QMW7sgCqDpuR1PL7GYMb6Gsrn6zGxpQW3P5Me9wYzIKdQkWR3 pJabedpWcdCQtB2/JaXoLazdNzHlc4lWTr59+Fmf1z0idXL0jGEyKKPojyb9DhkU3QGs hhJZBKBOOvKDKjR2dZYZ+CxW+uMWEzIAkYC3W2NKo89qb3ruuqtBtCI3mqF1C83/nCx5 HHBw== X-Gm-Message-State: AOAM532SOoEkEFNS63+L43NIBUZZz6FmqSmbj7zIuAOAlzPTbKW8Eh8m HY5CQjt3LGzMqmSlbTTNy/3hldp5yXWc3PDY2Y0= X-Google-Smtp-Source: ABdhPJxA4MxdL3btNbtuhjgFcArW3s8TM+jRGEWH6IXvu9exoL2X7zgjycWzhTFon24iqlNpkhjd6mzntWq2UEvWpdY= X-Received: by 2002:adf:e845:: with SMTP id d5mr23129830wrn.228.1596019490045; Wed, 29 Jul 2020 03:44:50 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 29 Jul 2020 13:44:37 +0300 Message-ID: To: Joe Ferguson Cc: PHP Developers Mailing List Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] [Discussion] Shorter Attribute Syntax Change From: someniatko@gmail.com (someniatko) Hello Internals, Here is a small comparison table based on current feedback, maybe it will bring some objective clarity to the discussion: (markdown below) Impact|`@@`|`#[]` ---|---|--- BC break|virtualy nonexistent|slightly broader: `##[` comments are now broken. Parser|no technical problems by now|no technical problems by now Extendability|less future-proof, arguably|more future-proof, arguably Grepability|harder, arguably|easier, arguably (however, consider an Attribute taking an array `[]` parameter.) Perception|similar to PHPDoc annotations, more familiar to PHP devs|more familiar to Rust devs Other issues are either speculative or insignificant (as for me): - causing future parsing issues: no evidence - "backfilling": there is, arguably, no use case for it. Code using PHP 8 features will target PHP 8 anyway. Code, compatible with both PHP 7 and PHP 8 would most probably use classic PHPDoc annotations. - "syntax no other language uses": this is probably insignificant. - "possibility of @@ moving to @ is near to 0": i am not sure anyone planned to move @@ to @, and if so, it would be an unnecessary BC break. I am personally in favor of `@@`, but just because it looks visually nicer to me. I see no strong objective reason to favor one over the other. If you want an ending token, maybe consider `@@Attribute@@`, personally I like those round-ish shapes :P. On Tue, Jul 28, 2020 at 5:47 PM Joe Ferguson wrote: > > Hello Internals, > > I've been working with Derick Rethans and others (thanks all!) on a Shorter > Attribute Syntax Change RFC which outlines reasons why the "#[]" syntax > would be preferred over the currently agreed upon "@@" syntax for Shorter > Attribute Syntax. > > An important part of the research that went into this proposal demonstrates > how "@@" will make handling attributes more difficult for PHP_CodeSniffer > (and similar tools) and shows how the alternative "#[]" syntax is more > friendly for these tools. > > You can find the RFC > https://wiki.php.net/rfc/shorter_attribute_syntax_change and I'm happy to > answer any questions as best I can. > > -- > - Joe Ferguson > JoeFerguson.me > osmihelp.org