Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111442 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 89182 invoked from network); 10 Aug 2020 16:41:46 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Aug 2020 16:41:46 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 02D6218054F for ; Mon, 10 Aug 2020 08:40:58 -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=-1.1 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_NEUTRAL autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from xdebug.org (xdebug.org [82.113.146.227]) by php-smtp4.php.net (Postfix) with ESMTP for ; Mon, 10 Aug 2020 08:40:57 -0700 (PDT) Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id 4FBCF10C243; Mon, 10 Aug 2020 16:40:56 +0100 (BST) Date: Mon, 10 Aug 2020 16:40:56 +0100 (BST) X-X-Sender: derick@singlemalt.home.derickrethans.nl To: Andreas Leathley cc: internals@lists.php.net In-Reply-To: Message-ID: References: <5c73b8d0-f477-83a0-4bd4-2fb8d11ad416@seld.be> User-Agent: Alpine 2.23 (DEB 453 2020-06-18) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Subject: Re: [PHP-DEV] [VOTE] Shorter Attribute Syntax Change From: derick@php.net (Derick Rethans) On Mon, 10 Aug 2020, Andreas Leathley wrote: > On 10.08.20 15:05, Markus Fischer wrote: > > Personally, and never gave it much thought TBH, the `@@` AND `<<`/`>>` > > in fact is the most "unreadable" version to me because duplicate > > occurrence of a single character somehow creates a noise _for me_, > > > > I don't feel eligible to have a vote, but based on that and certainly > > aware IDEs in the future will help with this, I would vote for > > _anything_ not duplicating characters, i.e. favoring `#[]` or `@[]` > > It is a pity that syntax with ending delimiters and syntax with no > ending delimiters are now mixed in the discussion, instead of first > finding a concensus if delimiters are even needed or what > advantages/disadvantages they have. It missing an ending delimiter was my first reason for wanting to get something better than @@. I don't particularly care much if it ends up being @[], #[], <<>>, or other things such as @:( ). In my original email, I solicited other syntaxes (with patches), but none were brought up. > Because there are many alternatives in terms of syntax - looking back > at the very first vote about attributes the @: syntax doesn't seem so > bad, if no ending delimiters are needed. In the new RFC all > alternatives to @@ have delimiters and it is suggested having them is > good, yet the possible advantages of delimiters are never explained, > ideally with some real-world examples showing why delimiters would be > good to have. If you have something to open, and close, there there is a distinct area that forms the whole definition of a thing. That's why functions, and classes have { and }, if and other control structures have ( .. ), etc. Being able to define a whole "thing" easily with an open and closing set of symbols, allows for better mental parsing. It also means that syntax highlighting tools can map the opening part with the closing part. (VIM for example, uses the % character to jump between opening and closing symbol). cheers, Derick -- PHP 7.4 Release Manager Host of PHP Internals News: https://phpinternals.news Like Xdebug? Consider supporting me: https://xdebug.org/support https://derickrethans.nl | https://xdebug.org | https://dram.io twitter: @derickr and @xdebug