`restricted` member variables

Dom Disc dominikus at scherkl.de
Thu Jun 23 10:45:13 UTC 2022


The longer I think about it (and that's really long, because of 
this thread), the more I dislike class private.
It's a bogus concept.
It make you think you have a strong type, but you can't prevent 
others from messing it up.

Maybe in very small projects (where it makes at least a little 
bit of sense to put everything in few files) it helps you to 
avoid making stupid mistakes (like using some private field in a 
function that shouldn't use it), but if the project grows the 
code must be re-organized anyway.
So it is much better to learn to do this from the start. And 
having one class in one file provides the same "protection" from 
stupid mistakes.


More information about the Digitalmars-d mailing list