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

Regan Heath regan at netwin.co.nz
Fri Jun 23 19:08:06 PDT 2006


On Sat, 24 Jun 2006 07:43:26 +0800, Boris Wang <nano.kago at hotmail.com>  
wrote:
> "Andrei Khropov" <andkhropov at nospam_mtu-net.ru>
> ??????:e7gs64$2ucq$1 at digitaldaemon.com...
>> Mike Parker wrote:
>>
>>> Boris Wang wrote:
>>> > the harm of these is more than the benefit.
>>>
>>> I disagree. I like them and do not want to see them go away.
>>>
>>> >
>>> > all these syntax produce non-readable, non-maintainable codes, and  
>>> even
>>> > more  in large project with many developers.
>>> That's why large teams have coding standards. If you are going to work  
>>> on
>>> a
>>> large project and something is unreadable to you, make sure your coding
>>> standards prohibit it. You'll still have to deal with it when modifying
>>> third
>>> party code, but there's nothing you can do about it.
>>>
>>> I find the syntax quite readable and have no trouble with it. So I
>>> strongly
>>> appeal that it not be removed.
>>
>> I agree with you.
>> I always like C++ way of declaring members instead of Java/C# way  
>> because
>> "public:" and "private:" sections visually separate interface and
>> implementation.
>> And if you want you can always establish coding standards for either
>> option.
>>
>
> In much C++ codes, the declaration and defination of a function is
> seperated, this is the main reason of colon-like syntax.
>
> Otherwize, in no case can Bjarne Stroustrup make the colon-like syntax.

I don't think you can make that assertion.

Like several people have said both the : and {} syntax are useful to group  
things together. That alone is reason enough to use them in C++ and indeed  
that is why/how I use them.

Like Derek has just shown (to my mind) the {} syntax makes a cleaner,  
easier to read example, and further many editors will help further by  
highlighting/finding and collapsing blocks declared with either : or {}  
something that simply isn't possible if you specify them all in every case.

Regan



More information about the Digitalmars-d mailing list