Parenthesis

Alexander Panek a.panek at brainsware.org
Sat Dec 23 07:51:52 PST 2006


I disagree.

This works well for scripting languages like Ruby, but then again, this 
is D, which has a C style syntax. And C style syntax just can't work 
without paranthesis.

Alex

NN wrote:
> What about removing unuseful parenthesis in 'if', 'for', 'while' ?
> E.g. instead of:
> if(a == b)
> {
>   while(c)
>   {
>      ...
>   }
> }
> We can write:
> if a == b
> {
>   while c
>   {
>      ...
>   }
> }
> 
> If someone writes parenthesis the code will compile too.
> So this is almost backwards compatible feature.
> 
> What about 'if' with one expression ?
> Almost everyone writes curly brackets for more than one expression, so there they will be always written, and there will be no bugs.



More information about the Digitalmars-d mailing list