Why is the 'protected' attribute considered useless?

Jonathan M Davis jmdavisProg at gmx.com
Tue Jan 29 21:55:35 PST 2013


On Tuesday, January 29, 2013 22:38:39 Chad Joan wrote:
> I've read more than once now that 'protected' is considered useless in
> D.  Why is this?

I've heard some people say it (though not many), but I have no idea why anyone 
would think that. You need protected if you ever want to override internal 
functionality. And in D, if you want to do NVI ( 
http://www.gotw.ca/publications/mill18.htm ), you'd use protected. So, I think 
that it's pretty clear that there are times when protected is very useful.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list