6 ms·
> Some years back I had to explain CR/LF issues to a young programmer who had never seen a carriage returning or a line being fed. I imagine that's the majority
by dntbnmpls 7y ago
> Some years back I had to explain CR/LF issues to a young programmer who had never seen a carriage returning or a line being fed. I imagine that's the majority of programmers now.
Yep. Never owned a typewriter and I never understood why CR/LF was a "newline" until I saw a youtube video showing the "CR" and "LF" of a typewriter. Then it all made sense.
Also, the fact that unix uses LF and windows uses CR/LF added to the confusion as well.
- zeveb 7y ago> Also, the fact that unix uses LF and windows uses CR/LF added to the confusion as well. And old Macs used CR. And some very rare old OSes used LF/CR! And then there's the practice on Unix of treating page feed as a scroll pause in pagers — I don't believe that I've seen that elsewhere. So much for a standard code for information interchange! Don't even get me started about the file, group, record & unit (i.e., field) separators …
- dan-robertson 7y agoForm feeds are commonly used in emacs source code (and elisp in general) to separate sections. They’re easy to type once you know what’s going on: C-q C-l
- dan-robertson 7y agoIn Unix it’s the job of the teletypewriter driver to translate LF into CRLF. I don’t know why things were this way. Maybe to make it easier to write Unix utilities in assembler. Maybe because it doesn’t make much sense for a program like cut to see a lone CR or LF if it wants CRLF to separate lines, so the problem is avoided by not tearing CR in any special way. I have no idea if overtyping (ie a CR without a LF) was ever used but surely the terminal line replacement use of CR didn’t exist when Unix was created