Hacker News new | ask | show | jobs
by anschwa 1738 days ago
Whitespace is definitely a legitimate critique of python.

The fact that people have learned to live with it or just ignore it is pretty irrelevant in my opinion.

Significant whitespace means I can't copy+paste without introducing bugs or breaking the code. It means code formatting becomes more complex to automate. It's seriously the dumbest language feature to defend and should be pretty acceptable to admit was a mistake.

I agree that having whitespace sensitive scoping isn't a compelling enough reason in itself to avoid python, but it is hard for me to understand how python programmers insist on defending it as a great design choice that "improves readability". To me that indicates an inexperienced developer who is unfamiliar with the alternatives.

I feel similarly for people who reject (or say they hate) static types and compilers.

3 comments

> It means code formatting becomes more complex to automate

No, it means it is both simpler to automate and less necessary, because syntactically correct code is already largely formatted.

I agree, as someone who likes a lot about Python (particularly its wide selection of libraries), the whitespace sensitivity is annoying.

However, it seems like part of the language that could conceivably be removed in future versions if defending it wasn't such a priority for many.

> I can't copy+paste without introducing bugs

What OS or clipboard manager are you using that strips out whitespace?

I've used Windows, macOS, and a whole host of Linux flavors. I haven't encountered this clipboard issue on any of them.