Re: [RFC][Draft] Sealed Classes

From: Date: Sat, 24 Apr 2021 20:01:30 +0000
Subject: Re: [RFC][Draft] Sealed Classes
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-114139@lists.php.net to get a copy of this message
Am 24.04.2021 um 21:51 schrieb Marco Pivetta <ocramius@gmail.com>:
> On Sat, Apr 24, 2021, 21:44 Olle Härstedt <olleharstedt@gmail.com <mailto:olleharstedt@gmail.com>> wrote:
> 
>> 2021-04-24 17:59 GMT+02:00, Saif Eddin Gmati <azjezz@void.tn>:
>>>> Doesn't this violate the principle: It should be possible to add new
>>>> features without touching old code?
>>> 
>>> This depends on which syntax is picked, both for and attribute syntax
>> will
>>> be completely BC.
>> 
>> I'm not talking about BC, but the maintainability of the new feature
>> itself. For the shape example, you'd need to edit the original file
>> for each new shape you add, which is detrimental for maintainability
>> and scalability. So what's a good use-case?

I'm with Olle here: This sounds like an anti-pattern to me.
The example could not be worse: Why should I not be allowed to add a hexagon shape?

> The main use-case of sealed types is being able to declare total functions
> around them.

Could you elaborate on what's the real-world use-case for your main use-case?
This sounds like another case of a feature based in (math) theory which leads to artificially locked
down code.

- Chris



Thread (76 messages)

« previous php.internals (#114139) next »