Sealed classes - would you want them in D? (v2)

Grady Booch gb at gb.com
Tue May 22 05:57:28 UTC 2018


On Tuesday, 22 May 2018 at 03:10:39 UTC, Bjarne Stroustrup wrote:
>
> Any debate about restoring the rights and autonomy of the 
> class, should not be killed off.
>
> Any programming language that discriminates against the class, 
> encourages class warfare, does not deserve to be called a 
> programming langauge.
>
> Let the debate continue....don't further disempower those 
> advocating for the rights of the class.
>
> Don't worry class, some of us will always stand up to those 
> that wish to destroy you.
>
> (ohh... is that what 'destroy' means... now I get it Andrei).

I agree with my close, long time friend, Bjarne.

Private access specifiers are used intentionally, in conjunction 
with carefully designed public method implementationsm, to 
enforce class invariants—constraints on the state of objects.

As langauges continue towards relaxing, and even 'destroying' 
these constraints, the class will become an extinct species.

And yet, the class/object model has proven to be a very powerful 
and unifying concept. If we destroy the class, we destroy the 
very core of not just the class, but also ourselves.

For that matter, if we destroy the interface of the function, we 
end up in the same disastrous situation. i.e pointers! god help 
us all, cause nobody else can!

Please, let's not destroy the autonomy of the object. We are 
ourselves, objects, afterall.



More information about the Digitalmars-d mailing list