Sealed classes - would you want them in D?

KingJoffrey KingJoffrey at KingJoffrey.com
Fri May 11 05:27:20 UTC 2018


On Friday, 11 May 2018 at 05:10:08 UTC, Uknown wrote:
> On Friday, 11 May 2018 at 04:43:09 UTC, KingJoffrey wrote:
>> On Friday, 11 May 2018 at 03:32:25 UTC, Uknown wrote:
>>>
>>> `private` is for outside the module. Within the module, 
>>> private is not applied because D wanted to avoid C++'s 
>>> `friend` functions.
>>
>> 'private' is "meant" to be part of the implementation of 'the 
>> class'.
>>
>> Whereas D makes it part of the implementation of 'the module' 
>> ( which is an even higher level of abstraction).
>>
>> This is an abomination!
>>
>> A class should have the capacity to protect its 
>> attributes/methods - even from the module.
>
> Let's not start this discussion again
> https://forum.dlang.org/post/tksnoqntxtpgqbwslxni@forum.dlang.org

My point is, that adding sealed or anything else to classes, is a 
waste of time, cause a class is D, is not really a class at all.

A class in D, is some unprinciple pseudo-class, that cannot truly 
encapsulate itself any longer.


More information about the Digitalmars-d mailing list