News for hackers. Stuff that matters.
Re:Python’s tug of war between beginner-friendly and advance... by Kim_Bruning on Thursday February 04, 2021 @08:09PM (#26031854)
I don't think anything will save you if you mess up your block structure. You can mess up your block structure with indents, or you can mess it up with braces.

Personally I think it's easier to spot mess-ups with indents. Some people think braces are easier. I won't fight with those people today :-).

But I don't think randomly cut&pasting code anywhere is a good idea. If you do paste code, you really should understand what the code is doing first.

Re:Python’s tug of war between beginner-friendly and advance... by kortex on Friday February 05, 2021 @12:01AM (#26033312)
This is absolutely true. If I paste some c++ into my IDE with unbalanced braces, it can throw the whole file off.

The real key is: treat excess indentation and nesting as a code smell. Python should aim for 5 tabs deep max, imho. Anything else should be refactored into functions.

Re:Python’s tug of war between beginner-friendly and advance... by belorn on Friday February 05, 2021 @06:51AM (#26035326)
I would add that the same is true for braces in c++. Debugging the differences between }}))} and }))}} can be quite difficult , as nested scopes is never easy in any language.