3 ms·
I'm a huge fan of an 80-character limit. But more importantly, of having a rigorously-defined limit. It has nothing to do with history. Horizontal scrolling is
by crazygringo 14y ago
I'm a huge fan of an 80-character limit. But more importantly, of having a rigorously-defined limit.
It has nothing to do with history. Horizontal scrolling is a usability nightmare, and in programming, word-wrapping introduces ambiguities.
Code should be designed to be read. You should be able to set your editor to the width defined by your project standards, and know that the code will always look the same to everyone. Clear coding is an art, and makes use of well-chosen indentation and linebreaks. Having different people use different widths in a single project destroys that art and legibility.
Now, why 80 characters? Here's my personal reason. According to "The Elements of Typographic Style", by Robert Bringhurst:
> "The 66-character line is widely considered ideal."
Assume that you'll often have 8 spaces of indent on the left side, and the a ragged right edge of perhaps 6 characters, and you get 66 + 8 + 6 = 80. There's nothing perfect about it, but an 80-character width is basically what's generally comfortable for comprehension by the human eye.
- cabalamat 14y agoAnother advantage of an 80-char limit is that you can display two pieces of code side by side in separate windows.