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

Derek Parnell derek at psych.ward
Sat Jun 24 04:23:37 PDT 2006


On Sat, 24 Jun 2006 20:52:08 +1000, Boris Wang <nano.kago at hotmail.com>  
wrote:

> And this is what ?
>
>>
>>       // six pages
>>      ...
>>
>>        int func3(...)
>>        {
>>        }
>>        int func4(...)
>>        {
>>        }
>>        int func5(...)
>>        {
>>        }
>>        int func6(...)
>>        {
>>        }
>>        int func7(...)
>>        {
>>        }
>>        a_type var2;
>>     }
>>     int func2(...)
>>     {
>>     }
>>     a_type var4;
>>     int func5(...)
>>     {
>>     }
>> }
>
> If you can make a good enough solution for this problem, i'll give up.

The problem you highlight with this example does not go away with either  
style of coding, because without seeing the code at the matching open  
brace, you can't tell what the scope of the contents is. For example, your  
example could begin with ...

   private void xfunc() {

making all the functions nested and thus sort of private. Without actually  
looking, you can't tell from just seeing the end of a braced code snippet.

>> private int var;
>>
>> public int func( .. )
>> {
>> }
>
> this syntax has no other problem, except that some people don't like it.

Oh well! Get used to the idea of free choice. Coders have been given the  
opportunity to code using the style that find helpful or best expresses  
their frame of mind. And that is not intrinsically a bad thing. I won't  
force my style on you and I expect that you won't force your style on me,  
okay?

> The codes of mango project is more beatiful than the others i readed.

Yes, it is lovely code and easy to read. Well done Mango team. A lot of  
that has got to do with adhering to coding standards regardless of what  
those standards are.

-- 
Derek Parnell
Melbourne, Australia



More information about the Digitalmars-d mailing list