Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2023-02-01 12:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?