3 ms·
Optimal for reading prose texts. I believe experiments have shown the optimal line width for reading speed and comprehension to be about 50-60 characters. But
by goto11 4y ago
Optimal for reading prose texts. I believe experiments have shown the optimal line width for reading speed and comprehension to be about 50-60 characters.
But as far as I known this have only been researched for reading prose. I doubt the result will translate directly to reading source code, which is read in a completely different way.
- fermigier 4y agoYes, experiments are lacking for code, but I believe the physiological principles (eye fixation, etc) still stand. Also: the optimal line width for prose seems to be 50-75 characters (including whitespace). Source: https://baymard.com/blog/line-length-readability https://baymard.com/blog/line-length-readability Assuming you're using a language where indentation is either mandated (e.g. Python) or recommended (e.g. C with "One True Braces"), with 4-spaces indentation (here again, no experimental evidence, but this seems to be the norm nowadays), and you don't abuse cyclomatic complexity in your functions / methods, you have let's say between 2 and 4 indents on the left so 80 is close to the optimum. Note: up to 100 is probably still OK from a readability POW. But this assumes that all readers are able to increase their window size from the default 80. That's probably true for people using GUIs, but may still be problematic for people with sight issues (e.g. people over 50 or with more serious medical conditions...).
- jstimpfle 4y agos/POW/POV/
- lcnPylGDnU4H9OF 4y agoReminiscent of tabs vs. spaces, this seems to be a new battle in an old war and readability is (allegedly) being held captive by both sides.