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

KingJoffrey KingJoffrey at KingJoffrey.com
Sat May 19 02:29:37 UTC 2018


On Friday, 18 May 2018 at 17:28:59 UTC, Steven Schveighoffer 
wrote:
>
> You can "simulate" this by putting the classes into their own 
> submodules of the same package.
>

That just another hack to get around the problem.

It's not a solution to removing the problem, from being a problem.

(yeah, I know, not everyone thinks it's a problem.. been there 
done that).

private(this) is a lot easier, than being told you need to 
redesign your whole class layout to accomodate D's 'private is 
really public' concept.

Lets get rid of the problem (that prevents many from using D in 
the first place), rather that constatnly come up with new ways of 
telling them find a way around it.

btw. I only know of two reasons why private is public so far 
(from discussions).

1 - Voldemort types (don't know what it is, and don't care).

2 - unittests (but, if the unit tests, testing your class, are 
outside your class accessing it's private parts, then I have 
trouble considering them to be unittests at all.



More information about the Digitalmars-d mailing list