Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118242 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 71723 invoked from network); 11 Jul 2022 00:16:05 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Jul 2022 00:16:05 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D497418037E for ; Sun, 10 Jul 2022 19:10:11 -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.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 10 Jul 2022 19:10:11 -0700 (PDT) Received: by mail-qt1-f176.google.com with SMTP id l2so2255556qtp.11 for ; Sun, 10 Jul 2022 19:10:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20210112.gappssmtp.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=XT8a9+6TLVpcirV9Z3s6xwbZSOWo07ch3JXrnhfCmq8=; b=CH/6GFgSiYrzg3DJ+fw2jxe2Ew0Pf6UP7DU60mHKODm7/uDMVQzHM2DrQP/VdLstqe 0l6ndcgFITV07shfGmSnJvhwZqH7e/6hUivW1b9hpWWuj5h9JU0HoUPQYjznIaNe7AjR 9qNRKk1AnszIMDLtPvoYQ2coc0xsq6M13mN62r+2InIpmcBdWBjumzwas864WSfrCHl0 CPJXOuDyUvKFrNs5BDHizVqremcICXlc5ThRli4i0LIIXYGOsKROBCGmcpJp47J3mEmt GjYOtJojNDAJ1eJfPB7Mp0GpIAopie6E+/io9xEnBUHmr9CvHWdcN0Do7kWCqp/7hRBb IlSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=XT8a9+6TLVpcirV9Z3s6xwbZSOWo07ch3JXrnhfCmq8=; b=OErWaIrfKPN1JEu3Nlf5leo7GBJzC1T7kw/UeyyiCnJVjb5c8faBuzZj6slmsy/AlL Ai4wa4Xz14VK42WoLkwRYayBSkImW/F7ynXqdwvcXKP2uq4PMf/WROk2BgULNPWFVjZW VrjmlS+armCtogBAdSxrxdrbMQ5TTjD1ZRHM+ya9U5+czU+Ixz0rSmV4G37MlE1kPCua hYuu8pWVtVrcNsDJu86SmA6yhG1Dpnp/fJgLvkB8jrpCi0tN7J4gGPpH7TpuYYKMjcCu LNhxYRu2FG+Qf5Zk39h6J//0FFE6KUnvxZHwzGttPFHbsjdsYmpVyTk6CPTGlXLus+Dw ZE1Q== X-Gm-Message-State: AJIora/dW4r0sCo8qXYhM1zHGmIUofeXz6WJnkaFdnYkTxrIuoUNdgCs byHHGyTQOFELVeWNccjFCXI3RJdR5rNqdHeR X-Google-Smtp-Source: AGRyM1sfsFh4WHtgxNQhmhXC1K2oajk4EMQOo1dfDI6fTO9DMeeoZZQ0fe+havoGhpYEJLwZUbDGng== X-Received: by 2002:a05:6214:4016:b0:473:2180:c03a with SMTP id kd22-20020a056214401600b004732180c03amr11590496qvb.83.1657505410542; Sun, 10 Jul 2022 19:10:10 -0700 (PDT) Received: from [192.168.1.10] (c-24-98-254-8.hsd1.ga.comcast.net. [24.98.254.8]) by smtp.gmail.com with ESMTPSA id t16-20020ac85310000000b003177969a48fsm4493716qtn.21.2022.07.10.19.10.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Jul 2022 19:10:10 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) In-Reply-To: Date: Sun, 10 Jul 2022 22:10:07 -0400 Cc: shinji igarashi Content-Transfer-Encoding: quoted-printable Message-ID: <59FBF770-ECEC-4004-A039-3C6EB58618F0@newclarity.net> References: To: internals X-Mailer: Apple Mail (2.3608.120.23.2.7) Subject: Re: [PHP-DEV] [RFC] [VOTE] Constants in traits From: mike@newclarity.net (Mike Schinkel) > On Jul 5, 2022, at 5:38 PM, shinji igarashi wrote: >=20 > Hello internals, >=20 > I've started the vote for the Constants in Traits RFC: > https://wiki.php.net/rfc/constants_in_traits >=20 > The vote will end on 19. July 2022. >=20 > Thanks! >=20 > -- > Shinji Igarashi The reaction to this RFC has been truly eye-opening to me. It never = occurred to me that Traits would be viewed so negatively by some on = Internals.=20 Personally I have found Traits to be one of the VERY BEST features of = PHP for a userland developer given their ability to reduce complexity = and allow for a cleaner code architecture within the applications I have = worked on. OTOH I have always found Traits to be an incomplete language = feature whose design gaps I have handled via rigidly standardizing how I = use them and by incorporating a lot of unfortunate boilerplate. Though I was surprised at first that some people so strongly dislike = Traits I then thought more about the incompleteness of Traits and wonder = if that is not the reason they feel Traits are problematic? I further = wonder how their use-cases differ from the ones I have been involved = with? Given the three people who spoke strongly against them on this thread = work heavily with PHP tools that make heavy use of reflection, code = analysis, and/or work on PHP core I wonder if their dislike for Traits = have a lot to do Trait-related problems they have when implementing PHP = core itself, frameworks, ORMs, testing tools, etc. rather than userland = development?=20 I am in no-way discounting the importance of core or tool development = but I wonder if they recognized issues in the implementation-of and = design decisions related-to Traits that most userland developers rarely = ever see because of their core and/or tool development work? Further, I wonder if their dislike of Traits is more of an X-Y problem? = IOW, that because they have seen issues with Traits they view the = solution to tamp down on Traits rather than the solution being to fill = in the design gaps and implementation issues with Traits? ------ So, can those who spoke against Traits please explain more details = about: 1. How do Traits have "built-in accidental complexity?" =20 2. How does `use TRAIT1, TRAIT2, TRAIT3` semantics result in = "mind-boggling over-complicated?" 3. What extra compatibility checks are required for Traits? 4. What are the potential error scenarios that are "unnecessary," why = are they unnecessary, and what alternative could you envision?=20 5. What about the implementation of Traits do you strongly dislike, what = type of implementation would be better, and could PHP change the = implementation and still retain backward compatibility? ----- I pose these questions in hopes to discern among Internals if Traits are = actually the problem or if instead Traits could be improved to solve the = concerns states in this tread, which might require some longer-term = deprecation of some of the problematic aspects of Traits. -Mike P.S. I also want to talk about the issues I have with the RFC itself and = what other things I see that I think are design gaps in Traits, but I = don't want to create an email to the list with more than one focus. = I'll follow up later with those other issues.