this post was submitted on 05 Apr 2025
141 points (88.1% liked)
Programmer Humor
22262 readers
455 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
\n is fun until you’re an a system that needs an additional \r
Unix needed only \n because it had complex drivers that could replace \n with whatever sequence of special characters the printer needed. Also, while carriage return is useful, they saw little use for line feed
On dos (which was intended for less powerful hardware than unix) you had to actually use the correct sequence which often but not always was \r\n (because teleprinters used that and because it's the "most correct" one).
Now that teleprinters don't exist, and complex drivers are not an issue for windows, and everyone prefers to have a single \n, windows still uses \r\n, for backward compatibility.
Bedeviled NXP/ARM SDK stdlib. Hate it, we need \n\r there. Why????!?!?! What a PITA.