Why is the 'protected' attribute considered useless?

Regan Heath regan at netmail.co.nz
Wed Jan 30 02:40:54 PST 2013


On Wed, 30 Jan 2013 09:20:54 -0000, simendsjo <simendsjo at gmail.com> wrote:

> On Wednesday, 30 January 2013 at 03:38:39 UTC, Chad Joan wrote:
>> I've read more than once now that 'protected' is considered useless in  
>> D.  Why is this?
>
> ...
> * private and protected in D works at module scope, not class scope. You  
> can modify private and protected members from anywhere in the module.

I think this is the most common reason ppl think protected is useless,  
because it has no effect inside the module scope.. but by the same logic  
private is as useless, so..

R

-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/


More information about the Digitalmars-d-learn mailing list