Normalizing Const Syntax.

Bill Baxter dnewsgroup at billbaxter.com
Thu Apr 10 06:53:56 PDT 2008


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




More information about the Digitalmars-d mailing list