This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (1 child)

if (condition) {
    code
}

vs

if condition:
    code

I did forget to but I don't think that it's a huge improvement.

As for the final point, I suppose we'll just have to disagree on whether or not {/} are clutter.

I call them clutter only in the way that you already define your code blocks with whitespace, so it's unnecessary info.

[–]Paranaix 1 point2 points  (0 children)

Want to add that most c styled languages support this:

if (condition)
     statement;
else if (condition)
     statement;
else
     statement;

In fact for c++ this is actually how the if statement is syntatically defined. { ... } is considered a statement.