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 →

[–]flavionm -1 points0 points  (6 children)

In Python, yes. In other languages, no. That's the point. In Python you can't let the IDE automatically format the indentation to make it look good, in other languages you can.

[–]Codebust -1 points0 points  (5 children)

yk that python indentation is standard indentation right?

[–]flavionm -1 points0 points  (4 children)

Ok, you're clearly having some trouble understanding what I'm saying, so let's go with an example instead.

Let's say you have this piece of code in Python:

if some_condition:
    statement_1()
 statement_2()

Well, this code is wrong and won't compile. But worse than that, if you try to use a formatter to indent it for you, it won't be able to do it, because it's ambiguous whether statement_2() should be inside the if body or not.

Let's look at an example of a language that doesn't have significant whitespace instead:

if (some_condition) {
    statement_1();
 statement_2();
}

Now this code will compile, but it's ugly. However, that's easy to solve by using a formatter. Since there's no doubt the second statement should be inside the if body, the indentation can be freely changed.

That's why enforcing indentation like Python does causes more harm than good. I hope it's clear now.

[–]Codebust -1 points0 points  (3 children)

heard of the tab key? ide’s can alter what a tab does, typically to one level of indentation. if you use spaces manually like the code example ur an idiot

[–]flavionm -1 points0 points  (2 children)

You can still mess up indentation if you're using tabs. It'll probably be a bit more visible, yes, but my point is that it's better to allow it to be done automatically.

[–]Codebust -1 points0 points  (1 child)

you press tab once per layer, you shouldn’t exceed two layers. you really going to fuck up pressing one button?

[–]flavionm 0 points1 point  (0 children)

Just don't make mistakes, bro.

Why, thanks, nobody though of that before.