On Monday, April 18, 2016 at 8:49:33 AM UTC+5:30, Steven D'Aprano wrote: > On Mon, 18 Apr 2016 11:39 am, Rustom Mody wrote: > > > yes we can agree on this -- arbitrary line lengths are almost certainly > > unreadable. > > The problem then becomes so what is optimal? > > I really don't think it is a problem. We have about 400 years > of experience with printed text, and that experience tells us > that the optimal width for reading prose in Western languages > is about 60 characters, give or take. This width is optimal > for eye movement, and minimizes the number of errors and > reduces eye-strain.
No disagreement so far > > There's only so far that our eyes can follow a line to the > right without increasing stress or reading errors, and > likewise when returning back to the left margin. The longer > the line, the higher the chance of losing track, and the > physical effort it takes to read. (You have to move the eyes > further, and for extremely long lines, you may have to move > your entire head.) > > Long lines are simply harder to read because you have to > move your eyes more, and the longer the lines, the greater > the tendency to wander across the lines. Especially if the > lines are close together and the height of the lines is > small. (It boggles my mind how many programmers I've met who > routinely view their code in tiny physical heights, even > when reading it in fine detail.) > > The optimal width for eye-tracking (that is, the maximum > width for which the rate of such errors can be disregarded) > is somewhere about sixty characters per line. Maybe even this is ok > > The same eye-tracking considerations apply to code This is nonsense. The last attempt of making code text-ish was Cobol -- by most accounts an unhappy experience. What is more code needs to be read very intensively for comprehension "x... what is x where is it defined? (scan backwards) ah there? Uh no further back... No global..." My own estimate of increased back-n-forth scanning of code vs plain text is probably an order of magnitude ie close to 10 times Even if I grant that you are twice as good a programmer as I am it will become 5 times. You would have to be 10 times better than me to equalize to (my) plaintext rate But if you are that kind of genius you probably speed-read plain text as well. tl;dr 1. Different languages -- natural and computer -- have different optimal line lengths. 2. There is very scant data on that. 3. PEP8 style strictures only delay discovery and collection of such data -- https://mail.python.org/mailman/listinfo/python-list