Re: [RFC] [DISCUSSION] Compact Object Property Assignment

From: Date: Mon, 30 Mar 2020 09:23:23 +0000
Subject: Re: [RFC] [DISCUSSION] Compact Object Property Assignment
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-109449@lists.php.net to get a copy of this message
Hi Jakob, On Sun, 29 Mar 2020 at 21:57, Jakob Givoni <jakob@givoni.dk> wrote: > > I understand and fully agree that COPA is narrow, but I don't really > understand why that's a problem - I proposed it exactly because I felt that > its simplicity is its force. > Low hanging fruit is usually something I would encourage to go after. > I believe it's a trivial implementation that can help in uncountable > situations where you just need to assign values to a predefined data > structure in a single expression. > > I'd really like to hear the arguments against such a cost-benefit > calculation. > Others have said it reasonably well, but for me, a key point is that it reserves a new syntax, with no obvious way of reusing that syntax for any wider features in future. That weighs in on the cost side of the calculation, because syntax is a somewhat limited resource - we often have problems adding things without ambiguity in the parser, and a language with lots of single-purpose syntaxes is going to be harder to learn than one with a few multi-purpose syntaxes. If COPA was the first part of a wider set of complementary features, building on it as a base, it would be more attractive to me; but as currently proposed, it feels like any new feature in this area (object initialisers, named arguments, etc) would have to compete with it instead. Regards, -- Rowan Tommins [IMSoP]

« previous php.internals (#109449) next »