Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114197 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 69693 invoked from network); 27 Apr 2021 13:31:30 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 Apr 2021 13:31:30 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EF349180511 for ; Tue, 27 Apr 2021 06:35:47 -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.1 required=5.0 tests=BAYES_05,KHOP_HELO_FCRDNS, SPF_HELO_NONE,SPF_NONE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from processus.org (ns366368.ip-94-23-14.eu [94.23.14.201]) (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 ; Tue, 27 Apr 2021 06:35:47 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by processus.org (Postfix) with ESMTPA id 859B45101324 for ; Tue, 27 Apr 2021 13:35:45 +0000 (UTC) To: internals@lists.php.net References: <5b9f1500-615a-48f1-815f-1d48b327ef90@processus.org> Message-ID: <7fc2ae67-f99e-30b8-64e5-12092408ec9f@processus.org> Date: Tue, 27 Apr 2021 15:35:44 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Authentication-Results: processus.org; auth=pass smtp.auth=pierre-php@processus.org smtp.mailfrom=pierre-php@processus.org X-Spamd-Bar: / Subject: Re: [PHP-DEV] [RFC][Draft] Sealed Classes From: pierre-php@processus.org (Pierre) Le 27/04/2021 à 15:21, Dan Ackroyd a écrit : > On Sat, 24 Apr 2021 at 15:03, Benjamin Eberlei wrote: >> There is a much less invasive way to add new keywords/flags >> to functions by using attributes. >> >> Imho this decouples new features from the language and reduces the "risk" >> of adding them to the language. > I think I disagree with this very strongly, and plan* to vote against > any RFC that embeds another language in annotations.** > > It might be quicker, easier, and more seductive to implement language > level features in them, but it is a massive trade-off in making code > hard to reason about. > >> That should increase the likeliness of it >> getting accepted in my opinion. > This can also be pronounced as "makes it more likely to slip bad ideas > in core without thinking them through fully". > > My experience of annotations being used as an embedded language is > Java, and it's one of the reasons why I no longer use that language. > > Not only is code with many lines of annotations hard to read, it > results in behaviour that is very hard to reason about. I literally > spent 40 hours (spread over the course of 5 weeks), trying to figure > out this bug https://stackoverflow.com/q/9072749/778719 . If my > colleague hadn't been able to tell me the answer, the only way I could > have debugged the problem myself is using a bytecode level debugger, > to step through the internal details of what was happening. > > I'd prefer it if we didn't repeat (what I consider to be) the mistakes of Java. > > cheers > Dan > Ack Hello, Yes, after reading a few answers I changed my mind and I do agree with you know, this is a language feature and should be in the language syntax and not in attributes. Regards, -- Pierre