Characters per line
In typography and computing characters per line (CPL) 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.
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 (8.5×11") also has been imposing limitations on the line length: it is only possible to print a maximum of 85 or 102 characters (with the font size either 10 or 12 characters per inch) without margins on the typewriter. With various margins (usually from 1 to 1.5 inches for each side, but there is no strict standard) these numbers may shrink to 55–78 CPL.
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 (but with the various number of lines), though with some terminals this number was either reduced by half to 40 CPL, limited to 64 CPL (SWTP CT-64, with 16 lines), or optionally increased to 132 CPL (DEC VT100 family, with 14 lines). 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 (and some other modern text presentation formats) 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.
|Characters per line||Programming style|
- IBM 80-column punched card format
- Column (typography)
- Line length (the equivalent concept for non-monospaced text)
- Department of the Army, ed. (1947). Teletypewriter Circuits and Equipment (fundamentals). Washington: US Government Printing Office. p. 69.
- Pomerantz, Ori; Vander Weele, Barbara; Nelson, Mark; et al., eds. (2008). Mainframe Basics for Security Professionals.
- Wells, April J. (2003). Oracle 11i E-Business Suite from the Front Lines. p. 168.
- "Difference between..LRECL = 133 and LRECL = 132". IBMMAINFRAMES.com - IBM Mainframe Support Forums. 2004.
- "Appendix K. Traditional Terminals and Printers". Terminals & Printers Handbook 1983–84. Digital. 1983.
- Ada 95 Quality and Style Guide
- PEP 8 Style Guide for Python Code
- Style Guide for Python Code
- GCC Coding Conventions
- Google C++ Style Guide
- Chromium Objective-C and Objective-C++ style guide
- Google Python Style Guide
- Google's R Style Guide
- "4.1. Line length". Java Code Conventions (PDF). Sun Microsystems, Inc. 1997. p. 5.
- Mozilla Coding style
- Object Pascal Style Guide
- Conway, Damian (2005). Perl Best Practices: Standards and Styles for Developing Maintainable Code. O'Reilly. p. 40. ISBN 978-0-596-55502-3.
- PSR-2: Coding Style Guide
- The Ruby Style Guide
- CCM4 self-imposed limit
- Android Code Style Guidelines for Contributors
- Google Java Style
- Common Lisp Style Guide
- Google Common Lisp Style Guide
- "Linux kernel code style as of June 2020". git.kernel.org. Retrieved 2020-06-13.
- FORTRAN 90
- Blink Coding Style Guidelines
- Moodle Coding Style
- Mono Coding Guidelines
- Effective Go