Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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 left. 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 port.

In reply to Re: Thoughts on designing a file format. by jonadab
in thread Thoughts on designing a file format. by demerphq

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • 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:
    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
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others chilling in the Monastery: (3)
    As of 2020-10-26 01:56 GMT
    Find Nodes?
      Voting Booth?
      My favourite web site is:

      Results (249 votes). Check out past polls.