Normalizing Const Syntax.

Koroskin Denis 2korden+dmd at gmail.com
Thu Apr 10 07:23:59 PDT 2008


On Thu, 10 Apr 2008 17:53:56 +0400, Bill Baxter  
<dnewsgroup at billbaxter.com> wrote:

> Janice Caron wrote:
>> However, there is a reason why Walter has not made const-at-the-front
>> illegal, which is that /he likes it/. And so far as I can gather, the
>> reason that he likes it is because it means he is able to write
>>      const
>>     {
>>         /* lots of functions */
>>     }
>
> Which is a horrible syntax in my opinion.  Something to be avoided  
> rather than something to bend over backwards trying to support.  Why  
> should a big block-o-const only affect the 'this' arguments of functions  
> inside of it?  Not to mention, the bigger the block-o-const, the more  
> likely it is that someone reading the code will not see the const label.
>
> It's a bad idea in my opinion.
>
>
> --bb
>

The same could be said for private or static methods. Do you propose we  
should get rid of these, too?
IMO, it's a matter of style. You can but, you don't have to use that  
syntax.



More information about the Digitalmars-d mailing list