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

KingJoffrey KingJoffrey at KingJoffrey.com
Sun May 20 02:25:25 UTC 2018


On Saturday, 19 May 2018 at 21:25:37 UTC, 0xEAB wrote:
> On Thursday, 17 May 2018 at 10:34:18 UTC, Zoadian wrote:
>> If class level protection is added, please do not call it 
>> sealed.
>> People from c++ might be suprised by 'private' already. We do 
>> not have to confuse those c#ies too.
>
> I thought the same.
>
>
>> Module level protection is enough to hide implementation 
>> details though. So while i do understand why you want this in 
>> D, i don't think it is worth it to complicate the language for 
>> something you can work around easily by putting the classes in 
>> their own modules.
>
> I wouldn't consider putting classes into own modules a 
> workaround. In my opinion it's more or less the solution.

Requiring such a restrictive 'solution', just to protect your 
interface from human error, is a solution for some, and not 
others.

open your mind a little.


More information about the Digitalmars-d mailing list