[phobos] [dmd-internals] svn-->git migration

Sean Kelly sean at invisibleduck.org
Wed Jan 26 09:26:52 PST 2011


On Jan 25, 2011, at 10:20 PM, Jonathan M Davis wrote:

> On Tuesday 25 January 2011 21:53:18 Sean Kelly wrote:
>> On Jan 25, 2011, at 10:59 AM, Walter Bright wrote:
>>> It obviously goes back at least as far as ASCII itself. LF means "line
>>> feed", which advances the platen one line. CR means "carriage return"
>>> which moves the print head to the beginning of the line. These are
>>> separate operations, and a lot of older programs relied on it. ASCII
>>> terminals (and teletypes) all operated this way.
>> 
>> Most (all?) internet protocols require CRLF for line termination as well.
> 
> Considering what \n and \r\n are typically used for, \r\n is technically the 
> most correct, because you're both going to the next line and going to the 
> beginning of the line. However, given that you really never need to just go to 
> the beginning of the line or the same place on the next - or if you do, you need 
> something a lot more powerful (like ncurses) - it's rather silly to use two 
> characters for it. So, using \n makes good sense.

Terminals needed the distinction, but few are in use any more.  Probably in military use and in the back office of some large corporations.

> The problem, of course, is that there's plenty of legacy stuff that uses \r\n, 
> and so it would take a while to go away, even if everything switched to it. But 
> for whatever reason, Windows has never followed the rest of the world and 
> switched to \n (possibly because they prize backwards compatability so much, or 
> possibly because they just plain don't care what the rest of the computing world 
> is up to), so we're still stuck with both. Really, I think that everything 
> should use \n at this point, but until Windows starts to, we're pretty much 
> stuck. And like any compatability problem between systems, it causes problems 
> between systems.

That would be nice, but unlikely :-)



More information about the phobos mailing list