Parenthesis

NN nn-mail at bk.ru
Fri Dec 22 03:55:46 PST 2006


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