Characters per line
In typography and computing characters per line or terminal width refers to the maximal number of monospaced characters that may appear on a single line. It is similar to line length in typesetting.
History
The limit of the line length in 70–80 characters may well have originated from various technical limitations of various equipment. The American teletypewriters could type only 72 CPL, while the British ones even less, 70 CPL. In the era of typewriters, most designs of the typewriter carriage were limited to 80–90 CPL. The most widespread and standard paper size in the US also has been imposing limitations on the line length: it is only possible to print a maximum of 85 or 102 characters without margins on the typewriter. With various margins these numbers may shrink to 55–78 CPL.with the characters per line scales
coding form. Source code has 72 CPL, but a form is 80-characters wide. Last 8 positions are "identification sequence"
In computer technology, a line of an IBM punched card could consist of only 80 characters. The widespread computer terminals such as IBM 3270 followed this limitation, their monitors could show only 80 CPL, though with some terminals this number was either reduced by half to 40 CPL, limited to 64 CPL, or optionally increased to 132 CPL. Such line lengths have been carried over into text modes of personal computers.
The "long" line of 132 CPL comes from line printers of mainframes. However, some printers or printing terminals could print as many as 216 CPL, given certain extra-wide paper sizes and/or extra-narrow font sizes.
In modern computing
With the advent of desktop computing and publishing, and technologies such as TrueType used in word processing and web browsing, a uniform CPL has been made mostly obsolete. HTML uses dynamic word wrapping which is more flexible than characters per line restriction and may produce a text block with non-rectangular shape, just like in paper typesetting.Many plain text documents still conform to 72 CPL out of tradition.
In programming
Many style guides for computer programming define the maximum or desirable number of characters in a line of source code:Characters per line | Programming style |
72 | Ada |
79 | Python |
80 | |
90 | CCM4 |
99 | Python |
100 | Android Google Java Common Lisp Linux kernel |
120 | PHP |
132 | Fortran Blink Moodle |
180 | Mono |
undefined | Go JavaScript |