Reasons for source code line length limits (was: Maintaining Maximum Line Length When Using Tabs Instead of Spaces?)

Ben Finney ben+python at benfinney.id.au
Sun Dec 7 23:44:40 EST 2014


jtan <admin at grails.asia> writes:

> One reason why you would want max length 79 is because of working with
> terminals.

That reason is decreasingly relevant as terminals become virtual, in a
display window that can be much larger if we choose.

Much more relevant is the ability to have two or even three code windows
side-by-side, for comparison during a merge operation. For this purpose,
a 75–80 column limit is a great help.

But regardless of display technology, the biggest reason to stick to a
limit like 80 or less is: reader technology. The ability for humans to
comprehend long lines of text is poor, and there *is* a cognitive point
beyond which it's not helpful to have longer lines.

That line-length limit is different for different people, and many
readers (and especially code writers) will fool themselves that they can
read longer lines while unknowingly harming their comprehension. But for
sure, it remains relatively constant across generations of humans, no
matter how the display capacity increases.

-- 
 \     “If you can't annoy somebody there is little point in writing.” |
  `\                                                    —Kingsley Amis |
_o__)                                                                  |
Ben Finney




More information about the Python-list mailing list