3 ms·
And `explicit is better than implicit` is idiomatic python, but the language uses the most implicit characters available on the average keyboard (` ` and ` `) t
by reificator 8y ago
And `explicit is better than implicit` is idiomatic python, but the language uses the most implicit characters available on the average keyboard (` ` and ` `) to denote control flow.
- lmm 8y agoThe language uses indentation levels to denote control flow, and those are very explicit - much more so than braces in fact.
- reificator 8y agoThey're not though. They only exist as the relation between the edge and the start of content. How many levels of indentation are there on each line? https://i.imgur.com/s1WBHxU.png https://i.imgur.com/s1WBHxU.png Spoiler: Line 3 has no indentation while Line 6 has one level. Line 4 has a mix of tabs and spaces that would confuse Python. The fact of the matter is that indentation is white space, and white space is implicit by definition. It only exists as the gap between other things.
- lmm 8y agoIn that sense control flow only exists as the relation between other things, so it makes sense for it to be denoted that way. If a line with no code on it is indented in the forest and nobody hears it, does the line execute?
- Franciscouzo 8y agoStop using a legacy version of Python. You will get a "TabError: inconsistent use of tabs and spaces in indentation" exception if you use Python 3.
- reificator 8y agoI haven't used python with inconsistent indentation recently, that's true.