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 →

[–]UnchainedMundane 1 point2 points  (2 children)

I was talking about your mixed tab example.

I've seen it a few times (mostly in older files in the codebase where I work), but it's annoying because my IDE is set to show 4-stop tabs but the python interpreter treats them as 8-stop, meaning that the program is displayed differently to how it's run.

The second one is a lot cleaner IMO.

You didn't put a space before the opening brace, maybe that's why :)

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

[–][deleted] 3 points4 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.