
Why was CRLF/LF/CF to make developers life miserable - xydac
Why were so many End of line formats created for different operating system. Couldn&#x27;t it have been simpler to adapt to a predetermined standard to at least end the line in same fashion.
======
wyldfire
Well, first off -- do you understand what those terms mean? Why they're called
that, I mean? Probably you do, but just in case, I've detailed them below.

    
    
        Carriage return: return the carriage head to the margin regardless of what its current horizontal position is.
    
        Line feed: advance the position of the paper by one line.
    

These are teletype metacharacters that control the behavior of the "display"
for historical computers. As a result of being one of the early computer
standards, text file encodings and terminals have inherited these qualities.

What should a computer terminal/terminal emulator do when it encounters these
archaic control characters? Well, the carriage return could move the cursor to
the beginning of this current line, ready to over-write any text on this line.
And the line feed could move the position of the cursor down one vertical
line, leaving the cursor at this same position. In order to move to the
beginning of the next line, as is customary, you would need to perform both of
these steps.

Now imagine you're a computer OS vendor in the early days of computers and you
say to yourself: these metacharacters are a silly legacy of the teletype --
who would want to advance the linefeed without a carriage return? Let's just
make it implicit when you do a linefeed that we will mark the position of the
cursor at the beginning of the next line. And you can do that if you offer an
out-of-band channel ("termios", e.g.) to move the cursor around the terminal
independent of the print stream. But imagine you're another computer OS vendor
and you don't have that feature and if you get it later you have a bunch of
customers who wrote their software contingent on the explicit carriage-
return/linefeed behavior. Now, you might feel bound by compatibility to
preserve that behavior. Both OS vendors use what they call ASCII-encoded text
files, but the metacharacters now mean something slightly different.

EDIT: it sounds like I wasn't _too_ far off. But the canonical reference seems
to be the wikipedia entry cited in another post.

------
Davidbrcz
[https://en.wikipedia.org/wiki/Newline#History](https://en.wikipedia.org/wiki/Newline#History)

~~~
niftich
Summary: CR+LF was in common use because it directly descended from commands
used to directly manipulate a printing head. Multics started using LF only
because by that time the hardware was abstracted from the software, and Unix
later followed this convention.

See also,
[https://en.wikipedia.org/wiki/Carriage_return](https://en.wikipedia.org/wiki/Carriage_return),
which describes more about how early CR was used.

------
vram22
[https://en.m.wikipedia.org/wiki/Control_character](https://en.m.wikipedia.org/wiki/Control_character)

------
pravula
Obligatory XKCD:

[https://xkcd.com/927/](https://xkcd.com/927/)

