Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111347 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 62670 invoked from network); 6 Aug 2020 07:49:59 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Aug 2020 07:49:59 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2DEB11804D1 for ; Wed, 5 Aug 2020 23:48:06 -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 ; Wed, 5 Aug 2020 23:48:05 -0700 (PDT) Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id 77FF210C08F; Thu, 6 Aug 2020 07:48:05 +0100 (BST) Date: Thu, 6 Aug 2020 07:48:05 +0100 (BST) X-X-Sender: derick@singlemalt.home.derickrethans.nl To: Theodore Brown cc: PHP Developers Mailing List In-Reply-To: Message-ID: References: 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] [RFC] Shorter Attribute Syntax Change RFC 0.2 From: derick@php.net (Derick Rethans) On Tue, 4 Aug 2020, Theodore Brown wrote: > > #[Attr1, Attr2] # 15 chars > > @@Attr1 @@Attr2 # 15 chars > > # 4 lines, 53 chars not counting whitespace > @[ > AttrWithParam("foobar"), > SomeOtherAttr("fizzbuzz"), > ] > > # 2 lines, 52 chars > @@AttrWithParam("foobar") > @@SomeOtherAttr("fizzbuzz") Shall I do one where we count pixels? Because @@ is using a lot more of them... And there is also no reason why it can't be just: @[AttrWithParam("foobar")] @[SomeOtherAttr("fizzbuzz")] Although group is allowed, it doesn't mean it's always useful to do. @@Attr1 @@Attr2 Seems to me like a cat had trespassed on your keyboard, the *heavy* @@ also dominates the line. > I agree that we want the best syntax, not necessarily the best > **looking** syntax. I still believe that the @@ syntax offers the best > balance here. From the RFC: - No ending delimiter - Doesn't allow grouping - No forwards compat with PHP 7 - Not used ny another language And the "familiar with docblocks" is quite a stretch, as that doesn't use @@ either. I've only included it because it would be unfair if @@ had nothing positive going for it. cheers, Derick