Sealed classes - would you want them in D?

Jonathan M Davis newsgroup.d at jmdavisprog.com
Fri May 11 15:24:32 UTC 2018


On Friday, May 11, 2018 15:02:08 jmh530 via Digitalmars-d wrote:
> I think the last point in the conversation was "write a DIP".
> Nothing is going to change unless someone does that.
>
> Personally, I don't agree with the idiomatic D doesn't use
> classes much argument. If that's the case, then they should be
> removed from the language. The language supports OOP/inheritance
> and if this is something that makes that experience better, then
> let it stand on its merits. But a new keyword will not get added
> without a DIP.

D supports OOP, and OOP should work. It's just that if most code isn't using
classes much, then adding features specific to OOP isn't as valuable and may
not be worth the extra complication it adds to the language.

However, if a solid enough use case is presented in a DIP, then it could be
added. The fact that a feature relates to classes definitely doesn't make it
a guarantee that it's not worth having. It just reduces its overall value
and makes it so that it's likely going to need to present a stronger case
than a feature that helps a lot more code might. Ultimately though, it comes
down to how good the arguments and use cases presented in the DIP are and
how Walter and Andrei feel about it. And even if a feature were highly
likely to be accepted if a DIP were written, if a DIP isn't written, then it
isn't happening.

So, if someone feels strongly about a potential feature (whatever that
feature may be), and they want it in the language, they need to put in the
time and effort to write a solid DIP. Discussing it may help improve the
DIP, but ultimately, it's the DIP and how Andrei and Walter react to it that
matters.

- Jonathan M Davis



More information about the Digitalmars-d mailing list