News for hackers. Stuff that matters.
Re:Reasons Python Sucks by drewrv on Tuesday December 18, 2018 @01:42PM (#18709265)
These kind of problems can be solved or avoided altogether by a decent editor.
Re:Reasons Python Sucks by compiler-guy on Tuesday December 18, 2018 @01:52PM (#18709358)
I don't see how. An editor can help you get indentations that are syntactically valid, but can't possibly know if the programmer intends the program below to print plain "foo" or both "foo" and "bar".

  print("foo")
  # x is false for the problem
  if x:
    do_something()

    print("bar")

And to the parent who has written a lot of code but never had this problem, well, some people do.
Re:Reasons Python Sucks by mixmastamyk on Tuesday December 18, 2018 @02:45PM (#18709837)
That's a two space error and easy to see.

> never had this problem, well, some people do.

Neophytes also have a lot of problems with matching braces, neither is a panacea to those folks. But one is easier to read and type for everyone else, for years to come.

Re:Reasons Python Sucks by compiler-guy on Tuesday December 18, 2018 @02:51PM (#18709898)
It's a two space error in a trivial example that no editor can help with.

If the function is longer or their are a couple of additional levels of indentation, and it isn't a print statement, but some additional logic, it is a hard problem to spot.

Re:Reasons Python Sucks by mixmastamyk on Tuesday December 18, 2018 @02:56PM (#18709944)
Not true, look up indentation guides and whitespace visibility. Even my barebones editor has them and squashes ambiguity.

Still at some point one needs to be responsible for the code they write, braces or not. Braces are not a guaranteed solution either, if the author gives up complete responsibility.

Basically, this is a theoretical non-problem. The lack of braces pays back in readability every single day. Like +100 + -2, then complaining about the -2.

Re:Reasons Python Sucks by compiler-guy on Tuesday December 18, 2018 @03:51PM (#18710425)
I write python all the time, with editors that support this. People do encounter this problem.

You'll also note that I've never claimed braces were better, I'm just trying to explain OP's pont.

You may not encounter it, but "Hey it works for me" is not a legitimate answer.