I read a paper once that explained very clearly why the two character line endings (CR, LF) in DOS was a mistake
Now, let me explain why two-character line endings in
DOS was *not* a mistake...
First, you have to understand where the CRLF came from.
It was not invented for DOS. It actually comes from
a strict interpretation of the ASCII standard; CR
returns the carraige to the left, but does not feed
a line. LF feeds a line, but does not return to the
Granted, the notion of wanting just a CR or just an
LF in a text file is fairly absurd, but ASCII was
not designed *just* for files; it was designed to
also be suitable for communicating with devices such
as terminals and character printers. (Most thermal
receipt printers today are still charset printers
like this (ASCII printers are still quite common
in the US), and many impact printers as well.)
Now, DOS *could* have used one-character line endings
for text files on disk, sure. But then the files
would have needed to be translated by a driver for
sending to printers. This means running a daemon
on the system. Bear in mind, DOS was a single-tasking
system. It was possible to run something like a
daemon (these were usually called TSRs by DOS users,
after an API call ("interrupt routine" in DOS
terminology) that many of them used), but it was
undesirable to have very many. Hardware drivers
of this nature were particularly undesirable.
So DOS was designed to use *exactly* the same
standards in its text files as the text printers
used, as per the ASCII standard. This means
that vtab and htab, CR and LF, and also pagefeed,
needed to have the same semantics that the ASCII
standard gave them for printers. One upshot of
this is that printing is as simple as chucking
the file in the general direction of the parallel
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||