HISTORY
Although most typewriters had standardized on 72 CPL by mid century, IBM's well-known punch card system standardized the 80-character limit. This limit continued in the terminal interfaces of the next generation. Today, we don't have any such system-enforced limits, but many software development teams implement them anyway as a code style guideline.
SIZE STILL MATTERS
Even with today's huge screens, 80 characters per line is still helpful. Many developers use IDEs or tools like Vim to display multiple source code files side-by-side on screen.
Vim session split vertically with 80 CPL source code |
KEEPING IT TERSE
More importantly, though, having an 80-character limit forces developers to constrain the amount of logic in one line of code. Do you really need that ten-method chained ActiveRecord query on a single line? Hitting the 80 character limit is a great indication that you should refactor your code and break things out so they're more readable.
Does your software team enforce a characters-per-line limit?
No comments:
Post a Comment