On Thu, Feb 21, 2019 at 11:09 AM Abe Dillon <abedil...@gmail.com> wrote: > > [simon.bordeyne] >> >> I find that 100 to 120 characters is ideal as far as line length goes. > > Your finding goes against a long history of people attempting to present text > in the most readable way possible. > AFIK, the human fovea hasn't grown much larger in recent years.
You can't see the entire line in focus simultaneously anyway, so the line length is about how far you can flit your eye left to right, not the actual fovea itself. > [simon.bordeyne] >> >> On top of that, it's not uncommon to reach 6, even 7 indentation levels. > > It should be pretty uncommon. You might want to re-think your coding style if > you're regularly writing code that's so deeply indented. > A good trick is to use helper functions: > > #instead of this > if condition: > ...code > > #do this > if condition: > handle_it() And this is always cited as the "obvious" solution. The trouble is, unless "handle_it" has a name that tells you EVERYTHING about what it does, you probably will end up having to go look at its definition - which means a lot more flicking around. The cost of a long line has to be balanced against the cost of *avoiding* having a long line. Splitting a line into consecutive lines has less cost than breaking it out into a function, *unless* the function truly has its own meaning. ChrisA _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/