Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117401 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 72114 invoked from network); 22 Mar 2022 16:36:26 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Mar 2022 16:36:26 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E141C180382 for ; Tue, 22 Mar 2022 11:02: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.3 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_SOFTFAIL,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-oi1-f181.google.com (mail-oi1-f181.google.com [209.85.167.181]) (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, 22 Mar 2022 11:02:58 -0700 (PDT) Received: by mail-oi1-f181.google.com with SMTP id o64so20298859oib.7 for ; Tue, 22 Mar 2022 11:02:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OXEkOqTKTP1EE49hOlMoeCMrr1Bb5sHNPglAwr9sGrE=; b=xkIk/xDdT9dJfESqSOGdpnctCk5PCZdfe4FsnHTocN9/T7zMokA2S6EjkFUnWMf68y yLAoUgEXA1+KEHA7ayc1qLnl7cHx5e+JNY0mGzTx/9r7Z511bzlyHOcsmg5Yd9CYP0cV 5tBiD7XMm9skn2T3Jm/xdF74VM0zadkJWMpWhMHecB+IkgCLzi4ddcC3nT8tVDiBimIw 8GqmUCM997Z3z6Vx/nHazHFXmEZXlPlD7QsCVjysbnvt5CkkgCS6aRETlFW1Uu55QAl4 VPzjAVzMENAodWQLoZo67cx0v4dOjsmEFCRCdItVqZtDKNJtW4xQjKtlUuom90szXjcz VYmw== X-Gm-Message-State: AOAM530jUOq7QR2HsoRkYG/hRiQmLISVOFMy1Y4u9kkNH8ek/cr6ys6R 2ez3q9GptWc6YduUKKhFaJgo2YtKzNfdWWqLg2B/qw== X-Google-Smtp-Source: ABdhPJw+M0Q6XXSNBkN3IDULM3d4nVTDwVlQ1qBzbMhI3+GoXD1FDMsHIXydLdGRP/jHX5b2bDlzAEbEYXOh3fO7fhU= X-Received: by 2002:aca:1e16:0:b0:2ef:4b94:2cda with SMTP id m22-20020aca1e16000000b002ef4b942cdamr2614406oic.149.1647972177864; Tue, 22 Mar 2022 11:02:57 -0700 (PDT) MIME-Version: 1.0 References: <1289b56c-e766-4889-bbb2-06abb4e63a6d@www.fastmail.com> <841033de-3b13-8022-98dd-a577dd08790b@processus.org> In-Reply-To: <841033de-3b13-8022-98dd-a577dd08790b@processus.org> Date: Tue, 22 Mar 2022 13:02:47 -0500 Message-ID: To: Pierre Cc: Robert Landers , =?UTF-8?Q?Micha=C5=82_Marcin_Brzuchalski?= , Larry Garfield , php internals Content-Type: multipart/alternative; boundary="00000000000042f92c05dad26c89" Subject: Re: [PHP-DEV] Discussion: String streams From: pollita@php.net (Sara Golemon) --00000000000042f92c05dad26c89 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Mar 22, 2022 at 10:28 AM Pierre wrote: > Le 22/03/2022 =C3=A0 16:14, Sara Golemon a =C3=A9crit : > > Who's just a hard-nope on userspace operator overloading? If your > reasons > > go beyond foot-gun (and that is a valid reason), could you share what > those > > reasons are? > > > > I am a not so hard-nope against userland operator overloading because > it's magic. My day job is 20% writing code, 30% speaking with clients, > and 50% reading and using community code. Userland operators are not as > explicit as verbose method calls; and you can't ctrl-space an operator > in any existing IDE, it's not obvious at what they does when you read > code using them in most cases, and beyond that, in order to use them, > you have to read an external documentation. Yup. I generally file this all under the 'foot-gun' objection, because at the end of day if you've made an overload interface that makes your code hard to read and reason about, then you *have* foot-gunned yourself. Not dismissing it at all, because the struggle IS real. > And in the end, operators are just sugar for method calls. I don't > dislike writing $c =3D $a->plus($b) instead of $c =3D $a + $b, I even fou= nd > that there's some kind of elegance behind writing stuff explicitly. > There's no feature in the world that would be blocked by the lack of > operator overloading. > > 100% not going to argue with you on the accuracy of that statement. Of course, something being sugar doesn't mean it's not sweet. ;) -Sara --00000000000042f92c05dad26c89--