(no title)
marcoms | 9 years ago
--
As a side point, I hope switch statements are less like C and more like Rust (Rust happens to have better looking syntax, not just because its Rust):
match <identifier> {
<val> => {
//
}
..
}
C-style always creates confusion on how to indent blocks following case statements
david-given|9 years ago
erikpukinskis|9 years ago
__s|9 years ago
macintux|9 years ago
yarrel|9 years ago
http://wiki.c2.com/?AlwaysUseBracesOnIfThen
tekacs|9 years ago
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.
marcoms|9 years ago
achamayou|9 years ago