It's funny to start seeing more and more questions from people who started using computers with Windows 95.<p>Actually, not it's not, little punks making me feel old, get off my lawn.
Related is the question of why newspapers arrange their text in columns. According to another stackexchange thread†, studies as far back as the 1880s indicated that the optimal width for reading prose is 3.5 to 4 inches.<p>Of course, code isn't prose, but I'm still a fanatic about the 80-character limit. To assist with keeping lines of code short and sweet, I will often introduce aptly-named temporary variables and let the compiler sort out what's actually to happen.<p>I can easily fit four 80x84 windows on my external monitor (DejaVuSansMono 13 pt).<p>†<a href="http://graphicdesign.stackexchange.com/questions/3553/why-do-newspapers-use-multiple-columns" rel="nofollow">http://graphicdesign.stackexchange.com/questions/3553/why-do...</a>
While the initial reason may be historical, I've found that on smaller monitors 80 character width makes it just about wide enough to have two code windows side-by-side. That's why I usually tend to stick to that limit. Though on bigger monitors I often stick to 100.
80 characters is also comfortably within the limits for presenting code in most books, except for pocket reference sized books. The actual limits for most books are about 85 characters, so that leaves some leeway.<p>Even if I have the screen real estate, I don't think I'd want to intentionally write wide code, and I like self-explanatory names. On a 4k screen I might like Eclipse layouts that put the logging next to the code, rather than have very wide code.<p>Has anyone created examples of code that gains readability from being wider?
IME, there is a very strong correlation between good developers and short lines. Bad devs doesn't mind if some lines are 150+ chars long and require horizontal scrolling. They also don't care that much about consistent naming of symbols or having correctly indented code. There are very strong reasons for keeping your lines short, naming consistent and indentation in check. But at the end of the day, you either "get" it or you don't.
Back in the day, I used punch cards in college computer courses. Languages like FORTRAN, COBOL, and assembler were column dependent, e.g.<p>Col. 1 : Blank, or a "C" or "*" for comments
Col. 1-5 : Statement label (optional)
Col. 6 : Continuation of previous line (optional)
Col. 7-72 : Statements
Col. 73-80: Sequence number (optional, rarely used today)<p>With the sequence numbers if you dropped the deck and scrambled the cards, feed the pile through a card sorter machine to put them back in order. If you didn't bother with sequence numbers, another technique was to use a magic marker to draw patterns on the side of the deck to help with resorting it if you dropped it.
Just confirming that 80 characters is an idiotic and arbitrary "standard", propagated by nothing much more than cargo-culting<p>"Oh but it fits my screen, fits two-by-two on my screen" change font size, unless you're using the native 80x25 PC display (some kernel developers use that)<p>I can't imagine a worse use of developer time than making everything fit exactly inside 80 columns<p>Of course, not having a limit is bad as well, but the main issue is having a hard limit
Old computers (Spectrum, MSX) had 40x25 = 1000 character screens, because memory was scarce, and 1000 is a nice, round number.<p>From there, they upgraded to 80x25 (doubling the resolution!). Two things happened to make it possible: 1) memory got a bit bigger 2) computers started shipping with dedicated higher-quality monitors (e.g. MSX-2) instead of being hooked up to TVs, so it was actually possible to read 80 characters on a line, even though you had to squint a little.
Terminals were commonly 80 characters wide, which doesn't explain <i>anything</i>. Why were terminals commonly 80 characters wide? Perhaps terminals were commonly 80 characters wide because punch cards were commonly 80 characters wide, which doesn't explain <i>anything</i>.<p>Eighty characters is the "standard" limit for code width because eighty characters is the "standard" limit for code width.
Sure, the number 80 may be rooted in a very old design decision, but that doesn't mean it's necessarily bad or suboptimal because of that.<p>More isn't better in this case. When text gets too wide, it becomes harder to move your gaze from end of one line to beginning of another.<p>Also, the best number is probably not a hard limit, but a guideline/average to aim for.
The reasons why terminals are 80-character wide are well known and well documented all over the web. What's sad, is that newbies still have to ask on stackexchange or Hacker News about it, not knowing how to use a search engine. What are pupils taught in schools nowadays????
The most popular text mode on older computers was 80 chars wide. That's really it. No other reason.<p>I use 120, plenty of space to fit two code windows side by side and one file browser.<p>With HD screens and the verbose languages we use these days (and verbosity is not always bad), it's a bit silly to try to stick to 80 char cols.