4 ms·
Mind, this is not unique to Python. It's a bit more irritating in Python because indentation is significant, but I've seen a lot of unindented samples of other
by Semiapies 16y ago
Mind, this is not unique to Python. It's a bit more irritating in Python because indentation is significant, but I've seen a lot of unindented samples of other languages with correspondingly reduced readability. For some reason, I've most seen such sloppiness in presenting Javascript code.
- wvenable 16y agoYes, but the reduced readability is an easy fix in that case. You can copy the code into an editor and indent based on the braces or have your editor auto-format the code. Badly formatting code in other languages does not change the meaning of the code as it does in Python.
- Semiapies 16y agoI'm not sure what your point is, as I already acknowledged that in the comment you're responding to, while making it clear that my concern was readability of code examples on a web page. Are you going for a cheap "gotcha"?
- wvenable 16y agoMy point is poor readability of samples in other languages is a really simple fix. I have cut'n'pasted many code samples into editors just to re-intent them for reading. With Python, sadly, it's just not possible to that roboticly.