4 ms·
Lucky them. My latest gig is helping out a project where some fresh faced Mac and Windows devs have been writing nodejs and every other file used different line
by cs02rm0 7y ago
Lucky them. My latest gig is helping out a project where some fresh faced Mac and Windows devs have been writing nodejs and every other file used different line endings.
Somehow they had no idea, git certainly did though.
- gizmo686 7y agoI was working on a project where we were consuming a text document that Mac style line endings. Apparantly, old Mac systems used just carriage returns. Every developer knew this though, as no editor handled this out of the box. (Vim has a simple setting to enable this, but for some reason it is not on by default)
- rwmj 7y agoYes, Mac OS 9 and earlier (pre Mac OS X) and OS-9 (that's the RTOS, not the Mac operating system) both used CR for line endings.
- zaarn 7y agoBasically any combination of linefeed and carriage return may denote a new line. I've encountered some very old files using LFCR instead of the more modern CRLF.
- virgilp 7y agoI was curious and looked it up - according to Wikipedia, that happens on Acorn BBC and RISC OS. I never encountered it, guess they were not popular enough :) https://en.wikipedia.org/wiki/Newline https://en.wikipedia.org/wiki/Newline
- zaarn 7y agoI think some other machines used it too; a LFCR prevents the printhead from moving over the already printed areas, thusly it prevents smearing of ink on some very cheap printers due to freshly printed ink.
- bch 7y agoIt makes sense if you think of it in terms of a manual typewriter - the carriage-return lever winds the platen (the line feed), and if you keep pushing the lever, you return the carriage to the beginning. https://en.wikipedia.org/wiki/Typewriter#Standardization https://en.wikipedia.org/wiki/Typewriter#Standardization
- deleted 7y ago[deleted]
- fanf2 7y agoSpooled output was pretty obscure, though. For most purposes the BBC Micro and Archimedes used CR as the newline character.
- dbcurtis 7y agoLF CR was always wrong. On a real TTY, it often takes longer than one character time for the CR to execute. CR has to accelerate and decelerate an actual physical mass. LF CR did surface briefly in the early days of PC’s, I can’t remember where, but before the days of “glass teletypes” you learned very quickly not to do that. Adding a couple of NULs to let the print head settle down was sometimes necessary if you really wanted clean print.
- ttty 7y agoWhy does it matter? I'm writing node...
- rjsw 7y agoBBEdit could handle all the line ending styles.
- yellowapple 7y agoI ran into this with a CSV exported from the macOS version of MS Office (which broke things when importing it into SQLite so I could run queries on it). This was in 2019. So much for OS X switching to Unix-style line endings...
- raverbashing 7y agoOh I swear when I see some ^M on a diff I sigh loudly and ask what's the problem with some people. And I mean, why are any code editors on Windows saving with ^M endings?!
- cesarb 7y ago> And I mean, why are any code editors on Windows saving with ^M endings?! Because otherwise, when you open the file on Notepad, it shows up as a single long line (other text editors tend to be smarter and understand both kinds of line endings).
- wlesieutre 7y agoNotepad supports CR, LF, and CRLF now! https://devblogs.microsoft.com/commandline/extended-eol-in-notepad/ https://devblogs.microsoft.com/commandline/extended-eol-in-n...
- Kihashi 7y agoIIRC, MS recently updated notepad to understand Unix line endings, although I'm not sure if it's live for most people. https://devblogs.microsoft.com/commandline/extended-eol-in-notepad/ https://devblogs.microsoft.com/commandline/extended-eol-in-n...