4 ms·
You have the same problem of space/tabs in all other languages, except there is no error and it can silently mislead you in badly understanding code, or just ma
by sametmax 9y ago
You have the same problem of space/tabs in all other languages, except there is no error and it can silently mislead you in badly understanding code, or just make it harder to read for hours on big project created by several generations of dev.
- jacquesm 9y agoNo, in (almost) all other mainstream languages you have some kind of block-end block-start markers. {} or begin end or whatever the language uses. Significant whitespace was considered a bad idea in days long past but that lesson was forgotten. So Python has ... nothing. I program a lot in Python but this is one headache I could have done without. It also always makes me read a little bit further than I have to when looking at some block of code because you never know that something else might follow until you drop that indentation level back down. So now you have to count indentation levels.
- joshuamorton 9y ago>No, in (almost) all other mainstream languages you have some kind of block-end block-start markers. {} And in many languages, those are optional in certain contexts (as someone else mentioned: see heartbleed).
- jacquesm 9y agoYes, and in the 'optional' case the accidents happen, which should be a quiet hint that they should not be optional. if (a == b) do_this() and_always_dothis() ...
- jhasse 9y agoTotally agree. They should never be optional, either force them always or don't have them at all (like Python). Your code example wouldn't confuse anyone in Python as he knows that and_always_dothis() is inside the if.
- zephyrfalcon 9y ago"""Significant whitespace was considered a bad idea in days long past but that lesson was forgotten.""" Who exactly considered it a bad idea and why?