Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

Personally, while my windows are far wider than 80 characters, my code generally use shorter lines for a simple reason: readability. It's faster for me to scan a code fragment if I need to move (scroll the code, move my eyes) only on one axis. I use wider windows because it is convenient to split in two, to let me switch between files while keeping other files up in a fixed location.

The 80 width "limit" has survived to the extent it has not just because of tradition and compatibility, but also because it fits well within the range of what is most comfortable for most people.

Add to that the desire to ensure fixed-formatted text like code will be readable also on other peoples screens, and it becomes relatively irrelevant if you can fit 200 character lines on your screen and have eyesight that makes that comfortable even when using smaller screens, and don't mind moving your head all over the place.



That this is the top comment restores my faith in humanity, because it is exactly what I came to say: the adherence to 80 columns has nothing to do with refusal to accept change, and everything to do with enforcing readability. If a function is so many scopes deep that 80 columns has become unruly -- or if function or variable names are so long that this is an unacceptable limitation -- that's a reflection on the code, not on the 80 column limitation. The code should be refactored, intermediate expressions assigned to local variables, etc. -- all of which greatly assist readability.

Additionally, and as others have observed as well, the author (mistakenly, in my opinion) assumes that 80 columns was imposed by the punchcard rather than the punchcard reflected an approximation of readable line length. That this line length has an innate readability can be confirmed with this experiment: take a book off of the bookshelf, open to a random page and input a random line of text in your fixed-width text editor. Hardcover or paperback, small font or large, old book or new, you will find that the line is almost always less than 80 columns -- and often surprisingly close. One can quibble about the exact number, but it is clear that there is an innate connection between line length and readability -- and that enforcing that line length is an easy way of enforcing minimum standards of readability.


It also make code review easier, I can easily fit two versions of the same code side-by side on the screen with room for line numbers, blame, and diff characters leaving room for another window for man pages and other commands. Plus it prints nicely without wrapping one file portrait or two in landscape.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: