|
|
|
|
|
by tekacs
3390 days ago
|
|
What you linked is about braces around the /body/ of an if statement. What the GP poster was talking about was parentheses around the /conditions/ of an if statement. Note that Rust (for example) doesn't require the latter. In fact, if you always require braces (as in the post that you linked), then it's very easy to parse and read code which is lacking those parentheses on the condition. i.e. `if (condition) x = x + 1` would be hard to read without parens.
but `if condition { x = x + 1 }` (with mandatory braces) is quite clear. |
|