Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111364 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 84004 invoked from network); 7 Aug 2020 01:25:25 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 7 Aug 2020 01:25:25 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A858B1804C8 for ; Thu, 6 Aug 2020 17:23:42 -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,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07olkn2012.outbound.protection.outlook.com [40.92.15.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 6 Aug 2020 17:23:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DjODvxAzOy4rlg1ysrM97SnAhUsRcWxWjB/d3BYoDAFmaTczv6r2Kuep0rt/nr3RwHjj+gauO8qkw+G/3196twOYKP+l6UTz/8YQA0BOCLHp/oCYRMAmCCFvbR9JOFPWNJ6KfyaeGsyKXcaZ1u0r0Uwa6XjUgMyyohpL4jwwZtVKtvoYm3379rGpHwg+Pl7Z0nbaE6IPC4EGc5JbVHKst/qksjKGrfwOTbHH+jJ5/rSZPzLfBGp6CsrSlAGZc/65ksDx0Xql2IDnpLWPrxy/+hoE1hDtuanKLXPMSZ6qBJRA900SMI4OsM6XApM84HJgS6aS4KGgzSOTyXxMYboQew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=og/paI44iqUOmdJUF4fUoWlMJ5SFKfFFSLTTZ9ES+aE=; b=EJanJc7IRJ4S4EhBvAkSNGTUDRkFJJxfJGAziUxeZHuVs71xzeyjhjrCdeY9X8sWDBfbcZrblI29Qp8unmLy1ZyooCpZYHfmTO2IFZCRbvh+3U5XULKlmfvfHxn4GgOgqyV6e9jwsrVaCQq6Nw+KD1TukyeQnXqfWkcvs7lC13cvmB36HkT2BeQEkt3p0gUcLXZU/qB9rhzYbtiakcrSVIq9SvBk1AN5jsZbi2uLwPtXUZlusIoG/RNQA67V+i5C46mIj8fNUS7iAMa1U2rmcEFKuwOXbzm07HPCdG4SlISVmWzTJckOpVyB4v21J9MuqRIuJunUWh4SJdJoRvbtzg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=og/paI44iqUOmdJUF4fUoWlMJ5SFKfFFSLTTZ9ES+aE=; b=Kwwbq39Nwh5NBNyzDTdJRjFez8ZjEqsR7j6edcvToser6HnsOA9TRnPH2tv6/XnjTe1fX0s8EOy8oS0PqDZFV9orjsb49fxOen9M324CtPHzH++BBR3bfm8tV2is23ZqXx1y7Jd39os0h6OLQ0JGmFIwXML3F/Ww870rvuusZcLbfKe0mRIeNUk8Vua7EURO/e+LfFvU6DhvTwygnT7fddYGQszFZXJ9NhMwq7O2tmQOXNAGtIotSeU6wuuRWm2xyWgPFQz3e5X4LwbMR6/wtd3eNPbqP2AU8ZR3MPg++6E5+BlHt1OdqS5E4AcZzOs9Ut6CLEHkzox0Jjaty+aSFA== Received: from DM3NAM02FT053.eop-nam02.prod.protection.outlook.com (2a01:111:e400:7e71::4c) by DM3NAM02HT033.eop-nam02.prod.protection.outlook.com (2a01:111:e400:7e71::304) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.19; Fri, 7 Aug 2020 00:23:40 +0000 Received: from BYAPR05MB6535.namprd05.prod.outlook.com (2a01:111:e400:7e71::4c) by DM3NAM02FT053.mail.protection.outlook.com (2a01:111:e400:7e71::291) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.19 via Frontend Transport; Fri, 7 Aug 2020 00:23:40 +0000 Received: from BYAPR05MB6535.namprd05.prod.outlook.com ([fe80::fc6c:38b0:fa18:f355]) by BYAPR05MB6535.namprd05.prod.outlook.com ([fe80::fc6c:38b0:fa18:f355%7]) with mapi id 15.20.3261.015; Fri, 7 Aug 2020 00:23:40 +0000 To: Benas IML CC: Rowan Tommins , PHP Internals List Thread-Topic: [PHP-DEV] [RFC] Shorter Attribute Syntax Change RFC 0.2 Thread-Index: AQHWamWKUBRwNDrYsUOzfoBQKi8o6KkoJexGgAKAW4CAAAhPgIAADw+AgAAJNoCAABvtAIAAbz82gAAHqACAAFtL4w== Date: Fri, 7 Aug 2020 00:23:40 +0000 Message-ID: References: <20200806091749.64675445@mcmic-probook.opensides.be> , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:56F83E61256F038F82DCB152ECE906C90F3733D5111F29DFADCBF0073F7C38B7;UpperCasedChecksum:6C061B75471308102CBDFC3E0347A5632905CC63BA96A89B122B754190F12C34;SizeAsReceived:7611;Count:45 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [t09StNT5+V/uTYpzqqjXOwZ9eqwuWNe9] x-ms-publictraffictype: Email x-incomingheadercount: 45 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: 0bac9aab-c278-419f-8054-08d83a6822c4 x-ms-traffictypediagnostic: DM3NAM02HT033: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: dNWWVEq5nQry3IzlD0XGD5P7hof0IybHKRLejBXUdWhIug8JYlXSHFgOOFkTPlS3wv2JkPe+8n4FlMvYNsx9cvHFf+rj7OKHXoamRHgKRNAwxQoK8CJeYWUUtpmrBbxmZLz7c/N6cT0qK/XbiR9+9Kibb1c7m0Mu0eqgvXLpOGmCLWe6RK2+eXXBN2SBne9rnWiTWlQ9gb0e+CQRhzze1g== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR05MB6535.namprd05.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; x-ms-exchange-antispam-messagedata: 5FGmPIm+WKx7esajB1lLz1cEOsIR7PGrUQSwyX2R9tXlzeJDOXSpxNvtKI5FuYBSnh5SvqCBtOp0Kj2SlBwf/hf4bj+7eOObMuPTRwMswFrmuzH0dJuUecdtPeZ1m9J6ArEjw1cBgnwtDFqb/5YNaQ== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT053.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 0bac9aab-c278-419f-8054-08d83a6822c4 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Aug 2020 00:23:40.6818 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3NAM02HT033 Subject: Re: [PHP-DEV] [RFC] Shorter Attribute Syntax Change RFC 0.2 From: theodorejb@outlook.com (Theodore Brown) On Thu, Aug 6, 2020 at 12:30 PM Benas IML wrote= :=0A= =0A= > Hey Theodore,=0A= >=0A= > On Thu, Aug 6, 2020, 8:05 PM Theodore Brown wrot= e:=0A= > =0A= > > While none of our syntax options are perfect, I believe @@ has the=0A= > > best long-term tradeoffs because:=0A= > >=0A= > > - It doesn't break useful syntax=0A= > =0A= > Fair enough.=0A= > =0A= > > - It is equally or more concise than grouped attributes without=0A= > > adding complexity to the parser/compiler=0A= > =0A= > Are we really going to debate that ~30 lines of code add complexity?=0A= =0A= Hi Benas,=0A= =0A= I don't know how many lines of code it will be, since an=0A= implementation for it has never been finished. The patch currently=0A= linked in the RFC does not implement it.=0A= =0A= Even if we assume the implementation is only about 30 lines, it's=0A= still extra complexity that I don't understand the benefit of. I=0A= sincerely would like to know what advantage there is of grouped=0A= attributes over the `@@` syntax.=0A= =0A= - It is equally or more verbose than `@@` in real-world use cases=0A= - Adding or removing a second attribute with grouping can require=0A= modifying multiple lines, adding unnecessary noise to diffs:=0A= =0A= @@SomeAttribute("value")=0A= @@AnotherAttribute("value") # can be added/removed independently=0A= function foo() {}=0A= =0A= # vs.=0A= =0A= @[SomeAttribute("value")] # changes to:=0A= =0A= @[=0A= SomeAttribute("value"),=0A= AnotherAttribute("value"), # not added/removed independently=0A= ]=0A= function foo() {}=0A= =0A= - How much more added complexity will the grouped syntax require if=0A= we add nested attributes in the future? At the least it will have to=0A= be special-cased in some way, either to disallow grouping for nested=0A= attributes or to treat the grouped syntax the same as an array.=0A= =0A= `@@` avoids the need for additional complexity, special cased syntax,=0A= and having to modify extra lines when adding/removing separate=0A= attributes.=0A= =0A= > > - It is conceptually closest to the docblock syntax the PHP=0A= > > community is familiar with=0A= > =0A= > Well, if `@@` is similar to `@` (to me it isn't), we can say that=0A= > `@[]` is also similar to `@`.=0A= =0A= I would agree that `@[]` is more similar than `#[]` is. But arguably=0A= `@@` is still the closest since docblock annotations don't require=0A= being wrapped in array brackets.=0A= =0A= > > - It is aligned with the attribute semantics of the majority of C=0A= > > family languages=0A= >=0A= > In what way `#[]` or `@[]` aren't?=0A= =0A= The majority of C family languages use `@Attr` without an extra end=0A= symbol. This makes sense since attributes are simply metadata=0A= modifying the declaration that follows them, similar to visibility=0A= and type declarations.=0A= =0A= Best regards, =0A= Theodore=