3 ms·
It's easier to read something quickly if your eyes don't have to travel far. This is why newspapers (remember them?) are written in multiple columns across the
by sixtofour 15y ago
It's easier to read something quickly if your eyes don't have to travel far. This is why newspapers (remember them?) are written in multiple columns across the page.
This may be less of an issue with code, due to its structure, but I still find it much easier to read 80 column code than code that stretches across the screen.
If I'm reading code in an 80 column terminal I prefer the line breaks to come from the human that wrote it, to show and reveal structure, rather than having it arbitrarily broken at 80 columns by the editor.
Another reason is that most of your code won't stretch across the screen, but you need your window sized for the small amount of code that does, losing a bunch of screen estate to empty space.
But I don't worry too much about it.
- levesque 15y agoThis is an interesting bit of information. I sometimes find that an equation is harder to read after breaking it in many parts due to the 80 columns limit. It seems there is a compromise to make between the readability of single statements versus the readability of the code as a whole.
- sixtofour 15y agoPersonal preference can confound any rule of thumb. Cherry picked from here: https://duckduckgo.com/?q=readability+%22column+width%22 https://duckduckgo.com/?q=readability+%22column+width%22 https://en.wikipedia.org/wiki/Column_%28typography%29 https://en.wikipedia.org/wiki/Column_%28typography%29 "For best legibility, typographic manuals suggest that columns should contain roughly 60 characters per line.[1] One formula suggests multiplying the point size of the font by 2 to reach how wide a column should be in picas[2] — in effect a column width of 24 ems. Following these guidelines usually results in multiple narrow columns being favored over a single wide column.[3]" http://psychology.wikia.com/wiki/Readability http://psychology.wikia.com/wiki/Readability "Ease-of-reading is the result of the interaction between the text and the reader. In the reader, those features affecting readability are 1. prior knowledge, 2. reading skill, 3. interest, and 4. motivation. In the text, those features are 1. content, 2. style, 3. design, and 4. structure[1]. The design can include the medium, layout, illustrations, reading and navigation aids, typeface, and color. Correct use of type size, line spacing, column width, text-color-background contrast and white space make text easy to read. "
- nikatwork 15y agoCode is not prose. The layout rules that apply to a written article do not (necessarily) apply. I prefer code that can be quickly scanned, and hard wrapping at 80 columns (IMO) doesn't facilitate this. If someone doesn't like it, they can turn on text wrap.
- sixtofour 15y ago"I prefer code that can be quickly scanned, and hard wrapping at 80 columns (IMO) doesn't facilitate this." Then you shouldn't hard wrap at 80. Subject to any agreements with your team members. :) I'm just speculating on why some people recommend to break at 80, which was originally the length of a physical punch card and so has nothing much to do with readability in and of itself. Fundamentally, 80 is likely just the most likely common denominator (MLCD).