News for hackers. Stuff that matters.
Re:The Great Newline Schism by pcof on Monday January 18, 2010 @11:34AM (#1060146)
Am I getting too old and grumpy or are the kids today getting too young and clueless? For the sake of Odin, it's Monday - even the Sumerians had problems with incompatible newline markers depending on the type of clay used to make the tablet. This is certainly not news and I sincerely hope it doesn't qualify as hacker either.
Re:The Great Newline Schism by ajross on Monday January 18, 2010 @11:43AM (#1060175)
I share your grumpiness. But given the number of otherwise-smart people I've had to explain this to: yes, this is something that needs to be explained to the median reader of Hacker News. Too many developers in the modern world work only in abstractions and don't have any grounding in the way bytes are laid out in files.
Re:The Great Newline Schism by viraptor on Monday January 18, 2010 @11:10AM (#1060075)
What is the reason to share this article with anyone? Did he write anything about newlines we didn't know since '90s?
Re:The Great Newline Schism by alex_stoddard on Monday January 18, 2010 @11:13AM (#1060082)
I never realized Unicode had additional new-line characters. Does anyone have any experience using the Unicode variants across the Windows and Unix worlds? (Good experience would be more interesting than bad...)
Re:The Great Newline Schism by niyazpk on Monday January 18, 2010 @11:11AM (#1060077)
Idea for the next blog post: How different editors treat ' ` ‘ ’ “ ” ❝ ❞ etc differently
Re:The Great Newline Schism by alexkay on Monday January 18, 2010 @08:20PM (#1061249)
You forgot « »
Re:The Great Newline Schism by RyanMcGreal on Monday January 18, 2010 @12:04PM (#1060237)
It seems a bit otiose to complain about the awkward legacy effects of line break characters on a computer when we're still using querty keyboards.
Re:The Great Newline Schism by naz on Monday January 18, 2010 @11:14AM (#1060086)
Nothing to see here, just Microsoft continuing stubbornly to do the wrong thing
Re:The Great Newline Schism by ajross on Monday January 18, 2010 @11:49AM (#1060196)
Now, see, that's the kind of ignorance the article was trying to treat. It's very much not microsoft's fault. Early teletypes had two command bytes: "\n" (newline) would advance the paper, and "\r" (carriage return) would move the type head (on a typewriter, the paper carriage -- thus the name) back to the start of the line. If you wanted to do both, you had to send both.

So if you have a text file to print, you'll either need to include both command bytes or else have some "terminal driver" software do the translation for you from a single "end of line" marker. This feature was a Unix innovation. It didn't exist in other contemporary systems (VMS, for instance, from which CP/M and MS-DOS stole lots of other ideas).

So the problem was that Gary Kildall, in 1977, failed to recognize the great idea Unix had and cloned VMS behavior instead (and Bill Gates likewise cloned CP/M instead of Unix). And due to backwards compatibility pressure we're still living with the result. But it's clearly not a case of someone having made the "wrong choice".

Re:The Great Newline Schism by RyanMcGreal on Monday January 18, 2010 @12:07PM (#1060251)
I guess posting the article turns out to be valuable if it generates interesting and actually-informative comments like this one.
Re:The Great Newline Schism by chollida1 on Monday January 18, 2010 @11:48AM (#1060190)
Serious question.

Are they doing the wrong thing? Is there a standard that says the only line ending is \n.

Is the Mac also doing the wrong thing then but using just \r?

Re:The Great Newline Schism by olliesaunders on Monday January 18, 2010 @11:36AM (#1060150)
Yes, if MS changed to use 0xA (AKA \n or LF) then this problem would start to disappear.