Sealed classes - would you want them in D?

KingJoffrey KingJoffrey at KingJoffrey.com
Sun May 13 02:07:58 UTC 2018


On Saturday, 12 May 2018 at 18:19:48 UTC, Jonathan M Davis wrote:
>
> I have never seen encapsulation issues where someone 
> accidentally uses some private piece of a class or struct by 
> accident elsewhere in the module, and the code therefore ends 
> up with a bug.

Then you've never seem me program.

That bug you mention, is something that has often popped up in my 
program, because the compiler didn't warn me - hey, that stuff is 
private, shouldn't you be using the getter, or setter.

This loss of encapsulation, is why I no longer use classes in D.





More information about the Digitalmars-d mailing list