20

A line feed means moving one line forward. It's definition references feed.

In summary,'feed' has three meanings

  1. Give food to.
  2. Supply with material or power.
  3. Cause to pass gradually and steadily, typically through a confined space.

From which 'line feed' originate?

AbstProcDo
  • 2,682
  • 3
  • 13
  • 30
  • The phrase "typically through a confined space" is a modern bias (as in "feed the wire through the conduit"). The verb **feed**, meaning to supply something in a continuous manner (e.g. to be worked upon or processed), was used in the 1860s in factory and mill settings, and it was already being used with ratchet and pawl mechanisms (the kind used with early prototypes of the typewriter) at least as early as the 1870s. – Tᴚoɯɐuo Nov 30 '17 at 17:09
  • This patent mentions **line-feed**. https://books.google.com/books?id=QQ9LAQAAMAAJ&pg=PA1006&dq=%22line+feed%22&hl=en&sa=X&ved=0ahUKEwil9J3f4ubXAhWDSd8KHQr8DQ4Q6AEIKDAA#v=onepage&q=%22line%20feed%22&f=false – Tᴚoɯɐuo Nov 30 '17 at 17:13

3 Answers3

61

Back in the old days, when the world was black and white (at least on TV), telephones had wires attached to them and "mail" involved a lenghty process of applying ink to paper as well as a delivery system involving boxes, mailmen and stamps, in those days there used to be machines that could transfer letters to a piece of paper by means of pressing a key.

These machines, know as typewriters back then, were fed a sheet of paper, which was transported in the upper part of the machine, called a carriage.

When you reached the end of the line, you would return the carriage so you could start typing again at the beginning (left side) of the paper. Also, if you wanted to type on the next line, you also had to move the paper one line up, or feed a new line into the machine.

enter image description here

The handle on the left side of the typewriter usually did both those things at the same time, it returned the carriage and fed a line.
Apart from the line feed we still use the carriage return in computers today (ASCII code 13 is CR, or Carriage Return, while code 10 is LF, or Line Feed) and they are often used together at the end of a line (also seen sometimes as "\r\n" for return & newline)

Here's another typewriter, with a sheet of paper in it. After every letter, the carriage with the paper would move to the left, so that the next letter would end up right next to the last one. At the end of the line, the whole carriage would stick out on the left side, and using the handle, you could move it back to the right. At the same time, the paper would move up one line:

enter image description here

AbstProcDo
  • 2,682
  • 3
  • 13
  • 30
oerkelens
  • 24,715
  • 1
  • 57
  • 79
  • 9
    Worth mentioning that ultimately it's definition 3 from the question - i.e. the paper is (as the typist types) steadily fed though the confined space adjacent to the platen? – psmears Nov 30 '17 at 15:16
  • 5
    While it true that he handle returned the carriage *and* fed a line, it was possible to 1) just return the carriage (by pushing it); 2) just feed a line, by turning the knob at the side of the carriage. – Martin Bonner supports Monica Nov 30 '17 at 15:33
  • 23
    To someone old enough to remember seeing typewriters in the wild, this may read as a little snarky. To those young enough to have never heard of typewriters, this will likely read as a more sincere (if mildly tongue-in-cheek) explanation. As someone roughly in between those age groups, I think it's fine; it's a little sarcastic, but good-naturedly so. – anaximander Nov 30 '17 at 16:52
  • 2
    @MartinBonner Hence the existence of two *separate* control characters for “carriage return” and “line feed” in the basic character set (and why DOS required both to denote a new line). Otherwise there’d be just the one. – Konrad Rudolph Nov 30 '17 at 17:38
  • 5
    The typewriter origin isn't really true. I learned to type on one of those, and moving to the next line was "Carriage Return", or CR in computer. It derives from the original Teletype-style printers, where there were two codes. CR moved the print head to the left margin, line feed moved the platen to advance (that is, feed) the fan-fold computer paper by one line. So that code was, logically enough, called Line Feed or LF. – jamesqf Nov 30 '17 at 18:03
  • I think I have found confirmation that separate codes for "carriage return" and "line feed" were already in use in Teletype page printers in 1931 (and possibly earlier): http://www.circuitousroot.com/artifice/telegraphy/tty/codes/index.html#teletype-by-1931 – David K Nov 30 '17 at 23:49
  • 1
    @DavidK - definitely earlier.There is a patent from 1902 for a typewriting machine, that references the "line feed mechanism" and "line feed ratchet wheel" many times. –  Dec 01 '17 at 00:33
  • http://www.google.com.pg/patents/US694602 –  Dec 01 '17 at 00:43
  • 1
    @hatchet Good point; the reference to ASCII CR and LF codes in this answer has focused some of us on the origin of the idea of _encoding_ a line feed for the purpose of data transmission, but the use of "line feed" to describe the _mechanism_ (or action thereof) may be much older. – David K Dec 01 '17 at 01:18
  • Only Windows hasn't abandoned the typewriter relic of combining carriage return and line feed characters. The vast majority of software developers wish MS would get with the program and just adopt the single character standard like everyone else. – jpmc26 Dec 01 '17 at 14:03
  • 1
    @jpmc26 HTML also uses \r\n as its standard, if I'm not mistaken. – JAB Dec 01 '17 at 19:54
  • [This video](https://www.youtube.com/watch?v=FkUXn5bOwzk) shows it at 2:55 - you can see the paper move up and then the carriage slides to the right. Incidentally, the handle at the side was used to feed new lines in, just push it gently without pushing the carriage and it would ratchet a new line. If you really want some fun, youtube has a [1943 US Navy instruction video](https://www.youtube.com/watch?v=FCpZ3CP7IAs) on how to use one. – gbjbaanb Dec 02 '17 at 03:20
  • 2
    Teletype was literally automation of typing, so it's correct to say that the carriage return and line feed functions came from typewriters, but the use of specific codes to trigger these functions came from teletype. – barbecue Dec 02 '17 at 17:03
  • 2
    @JAB: No, HTML, XML & friends don't care (spaces, tabs, carriage return and new line all end up as being interpreted as "whitespace" and will typically be treated as if there had been a single space character or even nothing in its stead). *However* many line-based *protocols* of the last century (such as HTTP, SMTP, FTP, Telnet) *do* require CRLF line endings and while you probably won't find any software noadays that cannot also deal with plain a LF that is still, technically, considered application-dependant behaviour. – ntninja Dec 02 '17 at 18:25
  • @jamesqf Just for interest: When performing CRLF on a typewriter the usual method is to use the supplied lever to manually push the carriage home and the LF is supplied by a ratchet/ detent mechanism. BUT you can push the carriage back without using the lever - when LF does not occur and you can then perform overtype magic. – Russell McMahon Dec 07 '17 at 11:11
2

To me it looks like the third of those definitions is where line feed (LF) originated from.

Reading here about the history of the new line it seems that early teletype machines required the LF character in addition to the carriage return (CR) to give the machine enough time to position the print head at the beginning of a line.

Damo
  • 163
  • 5
  • In some implementations LF would CR LF but CR would just CR. AFAIR CRLF would CRLF and not CRLFLF, but my memory may be dimming. My first printers, repurposed for microprocessor output use, were surplus Creed brand Baudot code 45 or 50 baud upper case only teletypes. – Russell McMahon Nov 30 '17 at 18:33
  • 6
    CR and LF were separate because you could return the carriage all the way to the left and then over-type the line to ___ (underscore) or ---- (strike through) or retype the same text to **bold** it. – Rob K Nov 30 '17 at 18:58
  • And for a long time many TTYs could still be controlled the same way. A back space character didn't necessarily 'rub out' the character preceding the current insertion point, it just moved the insertion point back one place. – Rob K Nov 30 '17 at 19:00
  • @RobK And this allowed for use of the common typewriter technique of underlining characters by following each character with backspace and underline, construction of currency symbols such as ¥ from Y and =, ¢ from c and /, or addition of accent marks such as ^, ', `. If memory serves, some people used " for umlaut. Another trick was to send a CR and tiny fractional LF and reprint any bold characters on the previous line, then another CR and the balance of the LF. – Monty Harder Nov 30 '17 at 20:45
  • 1
    @RussellMcMahon: I suspect your memory may be dimming - I definitely remember getting printouts that had unintentional double line spacing due to the different interpretations of CR & LF (some machines would CRLF when sent CR, some would CRLF when sent LF, some would just CR or LF when sent the respective code, and getting software to send the right code(s) was generally a pain!) – psmears Dec 01 '17 at 10:57
  • @RobK: Not all teleprinters had any way of moving the carriage left by any amount smaller than a CR. A lever-activated or solenoid-activated mechanism that only support "advance one" and "reset" actions can be much simpler than one which also has to support "back one". – supercat Dec 01 '17 at 17:08
1

To me it looks much more like the second definition. It's from "feeding" paper into the place where it's actually printed: "Supply with material".

re definition 3, where "line feed" commands are involved, paper is most definitely not fed through a traditional printer "gradually and steadily", but rather in discrete steps.

With e.g. a laser printer the paper does move steadily but "line feed" commands still move the printing position down the page only occasionally and in definite steps.