Newsgroups: php.internals
Path: news.php.net
Xref: news.php.net php.internals:109343
Return-Path: <michal.brzuchalski@gmail.com>
Delivered-To: mailing list internals@lists.php.net
Received: (qmail 49086 invoked from network); 26 Mar 2020 18:31:29 -0000
Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5)
  by pb1.pair.com with SMTP; 26 Mar 2020 18:31:29 -0000
Received: from php-smtp4.php.net (localhost [127.0.0.1])
	by php-smtp4.php.net (Postfix) with ESMTP id A1612180509
	for <internals@lists.php.net>; Thu, 26 Mar 2020 09:56:25 -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,HTML_MESSAGE,
	RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS
	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: <michal.brzuchalski@gmail.com>
Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170])
	(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 <internals@lists.php.net>; Thu, 26 Mar 2020 09:56:25 -0700 (PDT)
Received: by mail-oi1-f170.google.com with SMTP id y71so6093530oia.7
        for <internals@lists.php.net>; Thu, 26 Mar 2020 09:56:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to
         :cc;
        bh=wdRkSb8QgPMFtcT/+lrKnPa5QLinxrUnlgCmOhYV+jo=;
        b=jNT2KIZrds+yDESPkbmppVh1Ip2AViNNbRg8FuuXv/hqztZ5VkgjCFL4TL71V7C+u/
         VFS7MYFVVQ2s2bl1NV5+HnlQnwJ1Mck5WfT3QQXtuL0FBU0IHrsTL/E3VA1Y2zhbzoUO
         psXipG2DZB8JgoBEQJ0jHtMvN3O3W5OcS3wyDakt4j5+bs+AyDQ+ZeRKnAAbmF5DXQWg
         33PvtuyLzHZoDAcc7N2GUKTHRerUN2zUm5XO2ExIN4lkj/dH3TkCSBPiE7GcKNQvnGZK
         YVZKO4LGbe8H7meh0+3+lI23hEcwGRAV3s7h4SPeEQ8W68a3kz10nDxiTNGcczCBGlRz
         dUtw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to:cc;
        bh=wdRkSb8QgPMFtcT/+lrKnPa5QLinxrUnlgCmOhYV+jo=;
        b=hzkTEzcWsCXDkFFOV1YJ2Wa5DjJdDqQgIqE7vQZXxA2eDTgyAhARCw1fvMSYhjCnVE
         GaF/QaZ+BrtF8dTGbtQ9MOAb4Q9QTUS2lpGK37qs4nsSrELmdKNfK3fTbwPOPVQiEBIW
         UTiz3mEF3JidCAmUEFXVOfTYTeL1zqk/kk3fM2rNi9NhoQoAJeVe68MIS3SsNCH/5dE5
         xKiBBYPfn2W1H0viqkGZ24u0W8bdjdv49/ffqN5GIcGOEJO8DPP4LiggkJGGWr1QNvGy
         aLkEOJynPtSFlzJ2H/SD1HItGu7LfFxlVqbLIhguoeomEhxaagykzM4aWfiaPAqK8fJT
         Hujg==
X-Gm-Message-State: ANhLgQ19+ZrrW/gk/A3mHJBVP5NcEzhEI4gmOn3S59BDIUPp39idxqWY
	zPqtUgIpQkFYBnYZoxe5925pOM2EA8AhjXjFnsk=
X-Google-Smtp-Source: ADFU+vs3J1o3lIvqzsuJCG/deLq2YLTw1D5xdZC6O6R3/7DfyfcqKhQyNeOtQ6Ot+4meCBWwWwrEHRGKa79o/wCvr4g=
X-Received: by 2002:aca:5444:: with SMTP id i65mr747420oib.101.1585241782026;
 Thu, 26 Mar 2020 09:56:22 -0700 (PDT)
MIME-Version: 1.0
References: <CAF+90c8tW27-rhrk8pLieMsEWa4WHEBciPX1zThME68zf6s2QQ@mail.gmail.com>
In-Reply-To: <CAF+90c8tW27-rhrk8pLieMsEWa4WHEBciPX1zThME68zf6s2QQ@mail.gmail.com>
Date: Thu, 26 Mar 2020 17:56:10 +0100
Message-ID: <CABdc3WqeyLQoJdbEeERn3pcZi9K+O8DBFgKo_01-wXDBVtwTwQ@mail.gmail.com>
To: Nikita Popov <nikita.ppv@gmail.com>
Cc: PHP internals <internals@lists.php.net>
Content-Type: multipart/alternative; boundary="0000000000004d053a05a1c4dd3c"
Subject: Re: [PHP-DEV] [RFC] Constructor Property Promotion
From: michal.brzuchalski@gmail.com (=?UTF-8?Q?Micha=C5=82_Brzuchalski?=)

--0000000000004d053a05a1c4dd3c
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

czw., 26 mar 2020 o 14:31 Nikita Popov <nikita.ppv@gmail.com> napisa=C5=82(=
a):

> Hi internals,
>
> I would like to submit the following RFC for your consideration:
> https://wiki.php.net/rfc/constructor_promotion
>
> This is based on one off the suggestions made in
> https://externals.io/message/109220, and some existing discussion on the
> topic can be found in that thread.
>
>
As I already said in linked topic. IMHO this is wrong and can be easily
overused.

A list of properties is changed into a list of constructor method arguments
which
can be easily overused on long argument lists and when the time comes to
have attributes then the list of promoted arguments with their annotations
and some extra blank lines then to improve readability could lead to
long constructor signature list on a different level of indentation which
also then always has to be un-collapsed in IDE and on the top of a class to
keep the track of properties where usually list of properties exists with
additional named constructors (always at the top).

Not even mentioning that mix of promoted and un-promoted argument list
would just feel awkward and that kind of mixed constructor where some of
arguments are assigned magically and some of them not can make it harder to
read.

And I'm not saying this cause I'm preparing another proposal for filling
the gap
between the use of ad-hoc array structures, and the use of well-defined and
type-safe value types.
I'm saying this because PHP was always verbose and easy to read/decipher
this solution IMHO has more drawbacks regarding readability than benefits.

Cheers,
--
Micha=C5=82 Brzuchalski

--0000000000004d053a05a1c4dd3c--