appeal again: discard the syntax of private:, public: static: private{}, public{}, static{}.

Jarrett Billingsley kb3ctd2 at yahoo.com
Fri Jun 23 07:10:15 PDT 2006


"Boris Wang" <nano.kago at hotmail.com> wrote in message 
news:e7gau0$22li$1 at digitaldaemon.com...
> the harm of these is more than the benefit.
>
> all these syntax produce non-readable, non-maintainable codes, and even 
> more in large project with many developers.

While I agree with your argument and personally always use per-member 
protection, other people obviously still like the other methods.

What might be a bit of a compromise would be to get rid of : and keep {}, 
since : has some issues (how do you turn off static, for example?).  {} at 
least introduces a sort of "segment" of code, and makes it possible to see 
when the attributes end.  With good indentation, and a good text editor, you 
can always find what protectection and storage class something is.

class A
{
    // The public "segment"
    public
    {
        method
        field..
        blah
    }

    // Any public static fields
    public static
    {

    }

    // Hidden stuff
    protected
    {

    }
}

Not that terrible. 





More information about the Digitalmars-d mailing list