Menu
Home Explore People Places Arts History Plants & Animals Science Life & Culture Technology
On this page
Characters per line
Max number of monospaced characters allowed on a 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.

Related Image Collections Add Image
We don't have any YouTube videos related to Characters per line yet.
We don't have any PDF documents related to Characters per line yet.
We don't have any Books related to Characters per line yet.
We don't have any archived web articles related to Characters per line yet.

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.1 In the era of typewriters, most designs of the typewriter carriage were limited to 80–90 CPL. Standard paper sizes, such as the international standard A4, also impose limitations on line length: using the US standard Letter paper size (8.5×11"), 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–1.5 inches (25–38 mm) 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 consisted of 80 characters. Widespread computer terminals such as DEC's VT52 and VT100 mostly followed this standard, showing 80 CPL and 24 lines. This line length was carried over into the original 80×25 text mode of the IBM PC, along with its clones and successors. To this day, virtual terminals most often display 80×24 characters.

The "long" line of 132 CPL comes from mainframes' line printers.234 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.5

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.

Many plain text documents still conform to 72 CPL out of tradition (e.g., RFC 678).

In programming

Many style guides for computer programming define the maximum or desirable number of characters in a line of source code:

Characters per lineProgramming style
72
79
80
88
  • Python, The Black code style23
90
100
102
120
132
140
180
undefined

With the increasing common use of larger widescreen monitors, some of these limits have been relaxed, as in the Linux kernel39 and FreeBSD.40

See also

References

  1. Department of the Army, ed. (1947). Teletypewriter Circuits and Equipment (fundamentals). Washington: US Government Printing Office. p. 69. https://books.google.com/books?id=itUXAAAAYAAJ&pg=PA69

  2. Pomerantz, Ori; Vander Weele, Barbara; Nelson, Mark; et al., eds. (2008). Mainframe Basics for Security Professionals. IBM Press. ISBN 9780132704342. 9780132704342

  3. Wells, April J. (2003). Oracle 11i E-Business Suite from the Front Lines. CRC Press. p. 168. ISBN 9780203508961. 9780203508961

  4. "Difference between..LRECL = 133 and LRECL = 132". IBMMAINFRAMES.com - IBM Mainframe Support Forums. 2004. http://ibmmainframes.com/post-3565.html

  5. "Appendix K. Traditional Terminals and Printers". Terminals & Printers Handbook 1983–84. Digital. 1983. https://vt100.net/docs/tp83/appendixk.html

  6. Ada 95 Quality and Style Guide http://www.adaic.org/resources/add_content/docs/95style/html/sec_2/2-1-9.html

  7. agda/agda-stdlib: Style guide for the standard library https://github.com/agda/agda-stdlib/blob/master/notes/style-guide.md#other

  8. PEP 8 Style Guide for Python Code https://www.python.org/dev/peps/pep-0008/#maximum-line-length

  9. Style Guide for Python Code http://pep8.org/#maximum-line-length

  10. Google C++ Style Guide https://google.github.io/styleguide/cppguide.html#Line_Length

  11. Chromium Objective-C and Objective-C++ style guide https://chromium.googlesource.com/chromium/src/+/master/styleguide/objective-c/objective-c.md

  12. Google Python Style Guide https://google.github.io/styleguide/pyguide.html#Line_length

  13. Google's R Style Guide https://google.github.io/styleguide/Rguide.xml#linelength

  14. Google JavaScript Style Guide https://google.github.io/styleguide/jsguide.html

  15. "4.1. Line length". Java Code Conventions (PDF). Sun Microsystems, Inc. 1997. p. 5. http://www.oracle.com/technetwork/java/codeconventions-150003.pdf

  16. "Linux kernel code style as of June 2020". git.kernel.org. Archived from the original on 2020-05-31. Retrieved 2020-06-13. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bdc48fa11e46f867ea4d75fa59ee87a7f48be144

  17. "Object Pascal Style Guide". Archived from the original on 2015-07-09. Retrieved 2018-03-14. https://web.archive.org/web/20150709152411/http://edn.embarcadero.com/article/10280#4.4

  18. "style(9) - OpenBSD manual pages". Archived from the original on 2016-05-24. Retrieved 2024-03-04. All code should fit in 80 columns. https://man.openbsd.org/style

  19. Conway, Damian (2005). Perl Best Practices: Standards and Styles for Developing Maintainable Code. O'Reilly. p. 40. ISBN 978-0-596-55502-3. 978-0-596-55502-3

  20. PSR-2: Coding Style Guide http://www.php-fig.org/psr/psr-2/

  21. The Ruby Style Guide https://rubystyle.guide/#80-character-limits

  22. OCaml Programming Guidelines https://ocaml.org/learn/tutorials/guidelines.html#Width-of-the-page

  23. "The Black code style - Black (stable) documentation". black.readthedocs.io. Retrieved 2024-06-28. https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html

  24. CCM4 self-imposed limit http://www.cgd.ucar.edu/cms/ccm4/codingstandard.shtml

  25. Android Code Style Guidelines for Contributors https://source.android.com/source/code-style.html#limit-line-length

  26. Common Lisp Style Guide http://lisp-lang.org/style-guide/#line-length

  27. Google Common Lisp Style Guide https://google.github.io/styleguide/lispguide.xml#Line_length

  28. Google Java Style https://google.github.io/styleguide/javaguide.html#s4.4-column-limit

  29. rustfmt Documentation https://rust-lang.github.io/rustfmt/?version=v1.5.1&search=#max_width

  30. How to Program Racket: a Style Guide https://docs.racket-lang.org/style/Textual_Matters.html#%28part._.Line_.Width%29

  31. PSR-2: Coding Style Guide http://www.php-fig.org/psr/psr-2/

  32. FORTRAN 90 http://web.ics.purdue.edu/~aai/fortref/html/xlf/xlflrm21.htm#HDRF90FREE

  33. Reid, John (2022-03-21), The new features of Fortran 202x (PDF) https://wg5-fortran.org/N2151-N2200/N2194.pdf

  34. Blink Coding Style Guidelines https://www.chromium.org/blink/coding-style#TOC-Python

  35. Moodle Coding Style https://docs.moodle.org/dev/Coding_style#Maximum_Line_Length

  36. Leach, Parker. "The Puppet language style guide". puppet.com. Retrieved 2024-06-28. https://puppet.com/docs/puppet/8/style_guide.html

  37. Mono Coding Guidelines http://www.mono-project.com/community/contributing/coding-guidelines/#line-length-and-alignment

  38. Effective Go https://golang.org/doc/effective_go.html#formatting

  39. "The Linux Kernel Deprecates The 80 Character Line Coding Style". www.phoronix.com. Retrieved 2024-05-31. https://www.phoronix.com/news/Linux-Kernel-Deprecates-80-Col

  40. "⚙ D30255 style: Relax 80 column rule". reviews.freebsd.org. Retrieved 2024-05-31. https://reviews.freebsd.org/D30255