Characters per line

Last updated

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.

Contents

History

The ruler on the carriage of an Olivetti Lettera 22. This typewriter can print only 87 characters in a line Particolare Olivetti Lettera 22.JPG
The ruler on the carriage of an Olivetti Lettera 22. This typewriter can print only 87 characters in a line

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.

Typometer with the characters per line scales Typometer 3.jpg
Typometer with the characters per line scales
A Fortran coding form (paper). Source code has 72 CPL, but a form is 80-characters wide. Last 8 positions are "identification sequence" FortranCodingForm.png
A Fortran coding form (paper). 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 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. [2] [3] [4] 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 Ada [6]

Agda [7]

79 Python [8] [9]
80
90 CCM4 [23]
100 Android [24]

Common Lisp [25] [26]

Google Java [27]

Rust (rustfmt default) [28]

102 Racket [29]
120 PHP [20]
132 Fortran [30] (until 2023) [31]

Blink [32]

Moodle [33]

180 Mono [34]
undefined Go [35]

JavaScript (JavaScript has no official style guide)

See also

Related Research Articles

<span class="mw-page-title-main">ASCII art</span> Computer art form using text characters

ASCII art is a graphic design technique that uses computers for presentation and consists of pictures pieced together from the 95 printable characters defined by the ASCII Standard from 1963 and ASCII compliant character sets with proprietary extended characters. The term is also loosely used to refer to text-based visual art in general. ASCII art can be created with any text editor, and is often used with free-form languages. Most examples of ASCII art require a fixed-width font such as Courier for presentation.

<span class="mw-page-title-main">IBM 3270</span> Family of block-oriented display terminals and printers made by IBM

The IBM 3270 is a family of block oriented display and printer computer terminals introduced by IBM in 1971 and normally used to communicate with IBM mainframes. The 3270 was the successor to the IBM 2260 display terminal. Due to the text color on the original models, these terminals are informally known as green screen terminals. Unlike a character-oriented terminal, the 3270 minimizes the number of I/O interrupts required by transferring large blocks of data known as data streams, and uses a high speed proprietary communications interface, using coaxial cable.

<span class="mw-page-title-main">Monospaced font</span> Font whose characters occupy the same amount of horizontal space

A monospaced font, also called a fixed-pitch, fixed-width, or non-proportional font, is a font whose letters and characters each occupy the same amount of horizontal space. This contrasts with variable-width fonts, where the letters and spacings have different widths.

<span class="mw-page-title-main">Typeface</span> Set of characters that share common design features

A typeface is the design of lettering that can include variations in size, weight, slope, width, and so on. Each of these variations of the typeface is a font.

<span class="mw-page-title-main">IBM Electric typewriter</span> Electric typewriter

The IBM Electric typewriters were a series of electric typewriters that IBM manufactured, starting in the mid-1930s. They used the conventional moving carriage and typebar mechanism, as opposed to the fixed carriage and type ball used in the IBM Selectric, introduced in 1961. After 1944, each model came in both "Standard" and "Executive" versions, the latter featuring proportional spacing.

In writing, a space is a blank area that separates words, sentences, syllables and other written or printed glyphs (characters). Conventions for spacing vary among languages, and in some languages the spacing rules are complex. Inter-word spaces ease the reader's task of identifying words, and avoid outright ambiguities such as "now here" vs. "nowhere". They also provide convenient guides for where a human or program may start new lines.

<span class="mw-page-title-main">Newline</span> Special characters in computing signifying the end of a line of text

Newline is a control character or sequence of control characters in character encoding specifications such as ASCII, EBCDIC, Unicode, etc. This character, or a sequence of characters, is used to signify the end of a line of text and the start of a new one.

<span class="mw-page-title-main">Computer terminal</span> Computer input/output device for users

A computer terminal is an electronic or electromechanical hardware device that can be used for entering data into, and transcribing data from, a computer or a computing system. The teletype was an example of an early-day hard-copy terminal and predated the use of a computer screen by decades.

In the written form of many languages, an indentation or indent is an empty space at the beginning of a line to signal the start of a new paragraph. Many computer languages have adopted this technique to designate "paragraphs" or other logical blocks in the program.

<span class="mw-page-title-main">Friden Flexowriter</span> Teleprinter

The Friden Flexowriter produced by the Friden Calculating Machine Company, was a teleprinter, a heavy-duty electric typewriter capable of being driven not only by a human typing, but also automatically by several methods, including direct attachment to a computer and by use of paper tape.

<span class="mw-page-title-main">Backspace</span> Key on a keyboard

Backspace is the keyboard key that originally pushed the typewriter carriage one position backwards and in modern computer systems moves the display cursor one position backwards, deletes the character at that position, and shifts back the text after that position by one position.

<span class="mw-page-title-main">Dot matrix printer</span> Computer printer popular in the 1970s and 1980s

A dot matrix printer is an impact printer that prints using a fixed number of pins or wires. Typically the pins or wires are arranged in one or several vertical columns. The pins strike an ink-coated ribbon and force contact between the ribbon and the paper, so that each pin makes a small dot on the paper. The combination of these dots forms a dot matrix image. They were also known as serial dot matrix printers.

<span class="mw-page-title-main">Teletype Model 33</span> 1963–1981 ASCII communications/computer terminal device

The Teletype Model 33 is an electromechanical teleprinter designed for light-duty office use. It is less rugged and cost less than earlier Teletype machines. The Teletype Corporation introduced the Model 33 as a commercial product in 1963 after being originally designed for the United States Navy. There are three versions of the Model 33:

In computer programming, a naming convention is a set of rules for choosing the character sequence to be used for identifiers which denote variables, types, functions, and other entities in source code and documentation.

<span class="mw-page-title-main">IBM 2741</span>

The IBM 2741 is a printing computer terminal that was introduced in 1965. Compared to the teletypewriter machines that were commonly used as printing terminals at the time, the 2741 offers 50% higher speed, much higher quality printing, quieter operation, interchangeable type fonts, and both upper and lower case letters.

Sentence spacing concerns how spaces are inserted between sentences in typeset text and is a matter of typographical convention. Since the introduction of movable-type printing in Europe, various sentence spacing conventions have been used in languages with a Latin alphabet. These include a normal word space, a single enlarged space, and two full spaces.

Coding conventions are a set of guidelines for a specific programming language that recommend programming style, practices, and methods for each aspect of a program written in that language. These conventions usually cover file organization, indentation, comments, declarations, statements, white space, naming conventions, programming practices, programming principles, programming rules of thumb, architectural best practices, etc. These are guidelines for software structural quality. Software programmers are highly recommended to follow these guidelines to help improve the readability of their source code and make software maintenance easier. Coding conventions are only applicable to the human maintainers and peer reviewers of a software project. Conventions may be formalized in a documented set of rules that an entire team or company follows, or may be as informal as the habitual coding practices of an individual. Coding conventions are not enforced by compilers.

<span class="mw-page-title-main">IBM Selectric typewriter</span> Line of electric typewriters by IBM

The IBM Selectric typewriter was a highly successful line of electric typewriters introduced by IBM on 31 July 1961.

<span class="mw-page-title-main">History of sentence spacing</span> Evolution of sentence spacing conventions from the introduction of movable type in Europe

The history of sentence spacing is the evolution of sentence spacing conventions from the introduction of movable type in Europe by Johannes Gutenberg to the present day.

Pitch is the number of (monospaced) letters, numbers and spaces in one inch (25.4 mm) of running text, that is, characters per inch, measured horizontally. The pitch was most often used as a measurement of the size of typewriter fonts as well as those of impact printers used with computers.

References

  1. Department of the Army, ed. (1947). Teletypewriter Circuits and Equipment (fundamentals). Washington: US Government Printing Office. p. 69.
  2. Pomerantz, Ori; Vander Weele, Barbara; Nelson, Mark; et al., eds. (2008). Mainframe Basics for Security Professionals. ISBN   9780132704342.
  3. Wells, April J. (2003). Oracle 11i E-Business Suite from the Front Lines. p. 168. ISBN   9780203508961.
  4. "Difference between..LRECL = 133 and LRECL = 132". IBMMAINFRAMES.com - IBM Mainframe Support Forums. 2004.
  5. "Appendix K. Traditional Terminals and Printers". Terminals & Printers Handbook 1983–84. Digital. 1983.
  6. Ada 95 Quality and Style Guide
  7. agda/agda-stdlib: Style guide for the standard library
  8. PEP 8 Style Guide for Python Code
  9. Style Guide for Python Code
  10. GCC Coding Conventions
  11. Google C++ Style Guide
  12. Chromium Objective-C and Objective-C++ style guide
  13. Google Python Style Guide
  14. Google's R Style Guide
  15. Google JavaScript Style Guide
  16. "4.1. Line length". Java Code Conventions (PDF). Sun Microsystems, Inc. 1997. p. 5.
  17. "Linux kernel code style as of June 2020". git.kernel.org. Archived from the original on 2020-05-31. Retrieved 2020-06-13.
  18. Object Pascal Style Guide
  19. Conway, Damian (2005). Perl Best Practices: Standards and Styles for Developing Maintainable Code. O'Reilly. p. 40. ISBN   978-0-596-55502-3.
  20. 1 2 PSR-2: Coding Style Guide
  21. The Ruby Style Guide
  22. OCaml Programming Guidelines
  23. CCM4 self-imposed limit
  24. Android Code Style Guidelines for Contributors
  25. Common Lisp Style Guide
  26. Google Common Lisp Style Guide
  27. Google Java Style
  28. rustfmt Documentation
  29. How to Program Racket: a Style Guide
  30. FORTRAN 90
  31. Reid, John (2022-03-21), The new features of Fortran 202x (PDF)
  32. Blink Coding Style Guidelines
  33. Moodle Coding Style
  34. Mono Coding Guidelines
  35. Effective Go