Live data from Hacker News

Why is 80 characters the 'standard' limit for code width?

programmers.stackexchange.com

31–40 of 46 posts

Re: Why is 80 characters the 'standard' limit for code width?

#32
Just confirming that 80 characters is an idiotic and arbitrary "standard", propagated by nothing much more than cargo-culting

"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)

I can't imagine a worse use of developer time than making everything fit exactly inside 80 columns

Of course, not having a limit is bad as well, but the main issue is having a hard limit

Re: Why is 80 characters the 'standard' limit for code width?

#33

The most popular text mode on older computers was 80 chars wide. That's really it. No other reason. I use 120, plenty of space to fit two code windows side by side and one file browser. 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.

It'd be nice if when people down-mod a post, they give a reason. The way it works is just useless.

Re: Why is 80 characters the 'standard' limit for code width?

#34

Just confirming that 80 characters is an idiotic and arbitrary "standard", propagated by nothing much more than cargo-culting "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) I can't imagine a worse use of developer time than making everything fit exactly inside 80 columns Of course, not having a limit is bad a…

I think the rationalizations devs use to defend their arbitrary choices are fascinating. Readability? My dead-tree Wall Street Journal uses 30 character width columns. NYTimes online is about 70 chars. New Yorker about 80. Textbooks, paperbacks, magazines, newsletters... all have different char widths. Yet I've never suffered an aneurism reading any of these things. The fact that it doesn't matter much would be sacrilege to most devs.

Re: Why is 80 characters the 'standard' limit for code width?

#36

Just confirming that 80 characters is an idiotic and arbitrary "standard", propagated by nothing much more than cargo-culting "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) I can't imagine a worse use of developer time than making everything fit exactly inside 80 columns Of course, not having a limit is bad a…

>propagated by nothing much more than cargo-culting

It's propagated because it's a standard, and it seems many people ARE comfortable with it. It also seems that I enjoy my font-size just the way it is.

I've just written my first reusable, outlive-my-employment level of code, and keeping my code under 80 lines was trivially easy. The only thing that was the slightest level of nuisance was that the function parser in notepad++ couldn't cope with a multi-line string definition inside a function.

The bulk of my time was writing clear, understandable and educational documentation for the library.

Why are you so hostile?

Re: Why is 80 characters the 'standard' limit for code width?

#38
Terminals were commonly 80 characters wide, which doesn't explain anything. 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 anything.

Eighty characters is the "standard" limit for code width because eighty characters is the "standard" limit for code width.

Re: Why is 80 characters the 'standard' limit for code width?

#39
Old computers (Spectrum, MSX) had 40x25 = 1000 character screens, because memory was scarce, and 1000 is a nice, round number.

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.

Re: Why is 80 characters the 'standard' limit for code width?

#40
post #38

Terminals were commonly 80 characters wide, which doesn't explain anything . 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 anything . Eighty characters is the "standard" limit for code width because eighty characters is the "standard" limit for code width.

It doesn't explain everything, but it does explain quite a bit -- notably it traces the history of the standard back to punchcards.
Post reply on HN