shebang strange thing...

Bengt Richter bokr at oz.net
Wed Jun 25 13:10:05 EDT 2003


On Tue, 24 Jun 2003 22:31:22 -0700, Erik Max Francis <max at alcyone.com> wrote:

>"Greg Ewing (using news.cis.dfn.de)" wrote:
>
>> Erik Max Francis wrote:
>>
>> > (Mac gets even fewer points,
>> > since it chose to do deliberately do smoething even more different.)
>> 
>> That's debatable. At least the Mac still only uses *one*
>> character for each end-of-line...
>
>At the time the Mac was created, line endings of LF (Unix) and CR LF
>(CP/M, DOS) were common.  The only reason you'd choose CR is to do
>something different.  Their implementation of data forks vs. resource
>forks are another example of Apple doing something different simply for
>its own sake, which introduce massive interplatform compatibility
>problems.
I'm not sure it's entirely fair to jump to the conclusion that Apple chose CR
as line end only to be different.

My interpretation is that going from CRLF to a single character signalled
a switch from hardware-control semantics to symbolic semantics. I.e., CR and LF
originally literally referred to printing hardware with a physical "carriage" like
a typewriter or -- keeping paper handling stationary -- a moving print head,
and line feeding actually fed paper a line at a time. They're still used when
dealing with devices and emulated/simulated devices, of course.

The CR is what you get when you hit the Enter key, so Apple did the most direct thing
in using that key code as an EOL symbol. Perhaps they thought that was "cleaner" and
that they would lead the way to a cleaner standard way of doing things when they
achieved market dominance ;-)

Of course, LF has (IMO) a better semantic relationship to the EOL meaning, so translating
the Enter key to LF seems better than CR. Either way, ISTM yet another symptom of what happens
when the hardware-oriented evolves towards the abstract. You wind up with vestigial hardware
semantics in abstract contexts where they don't really belong, e.g., as in one of my pet peeves:
drive letters in file paths.

Regards,
Bengt Richter




More information about the Python-list mailing list