Bill Kelly
8/22/2007 1:20:00 AM
From: Michael T. Richter
>
> UNIX, of course, being the half-bastard-child of real operating systems
> (MULTICS and ITS) that it was, had to do things differently. To save on
> space (!) its creators, in their nigh-infinite wisdom and judgement, plagued
> the world with the notion of only using "\n" to terminate text lines in text
> files. (Apparently saving one byte out of every line was important! Never
> mind that OSes on smaller machines than ever ran UNIX had no problem with
> that "wasted" carriage return....) Of course this meant that you couldn't
> just copy the bits of a document directly to the teletype. Oh, no. You had
> to open the file in a special text mode so the OS would convert things
> behind the scenes for you, switching every "\n" into a "\r\n" before sending
> it off to the teletype. This was perceived (incorrectly) as a Great
> Innovation.
It's sounding like it really was a Great Innovation in those days to separate the
model from the view. In retrospect it's taken for granted as good design.
The specific print head movement characteristics of a particular piece of display
hardware have no business polluting the internal representation of a portable
text file format.
> Later, as the UNIX infection set in, "smart" terminals (teletypes and glass
> screen) started to, if set appropriately, automatically convert line feeds
> into carriage return/line feed combinations. This was a feature added to
> make up for a misfeature in UNIX systems, though, not something that was
> really necessary.
A misfeature would be taking completely independent teletype carriage return
and line feed output control bytes, and perverting them into an atomic LINE ENDING
SEQUENCE PAIR.
A teletype doesn't need the carriage return and linefeed characters to
follow one another back-to-back. They're just independent ways to move
the print head. As I recall, I used to send carriage returns independently from
linefeeds to our teletype whenever I pleased, if I wanted to write over the same
line twice, for instance... for bold-face, underline, overstrike, whatever.
Taking two independent print head control characters, and artifically gluing them
together into an atomic line-ending marker, just adds noise to what should have
been a portable, device-independent text file format.
Thankfully the Unix guys got it right.
Regards,
Bill