Live data from Hacker News

CRLF is obsolete and should be abolished

fossil-scm.org

21–30 of 273 posts

Re: CRLF is obsolete and should be abolished

#21

Well, at least the title is honest. Straight up asking people to break standards out of sheer conviction is a new one for me personally, but it's definitely one of the attitudes of all time, so maybe it's just me being green. Can we ask for the typical *nix text editors to disobey the POSIX standard of a text file next, so that I don't need to use hex editing to get trailing newlines off the end of files?

People don't seem to mind when Chrome does it [0]. The response "standards aren't a death pact" stands out in particular.

[0] https://news.ycombinator.com/item?id=13860682

Re: CRLF is obsolete and should be abolished

#23

The article had some major gaffes. Teletypes never had a ball. The stationary platen models had type boxes and cylinders, but never balls.

Not sure whether this changes anything about your critique, but note that the IBM 2741 terminal embedded a Selectric typewriter:

> Selectric-based mechanisms were also widely used as terminals for computers, replacing both Teletypes and older typebar-based output devices. One popular example was the IBM 2741 terminal

https://en.wikipedia.org/wiki/IBM_Selectric

Re: CRLF is obsolete and should be abolished

#24
post #19

> various protocols (HTTP, SMTP, CSV) still "require" CRLF at the end of each line What would be the benefit to updating legacy protocols to just use NL? You save a handful of bits at the expense of a lot of potential bugs. HTTP/1(.1) is mostly replaced by HTTP/2 and later by now anyway. Sure, it makes sense not to require CRLF with any new protocols, but it doesn't seem worth updating legacy things. > Even if an est…

Thinking about it. Using CR alone in protocols actually make infinitely more sense. As that would allow use of LF in records. Which would make many use cases much simpler. Just think about text protocols like HTTP, how much easier something like cookies would be to parse if you had CR as terminating character. And then each record separated by LF.

That is so backwards incompatible that it is never, ever going to fly.

Re: CRLF is obsolete and should be abolished

#25
Define "abolish."

We could certainly try to write no new software that uses them.

But last I checked, there are terabytes and terabytes of stored data in various formats (to say nothing of living protocols already deployed) and they aren't gonna stop using CRLF any time soon.

Re: CRLF is obsolete and should be abolished

#26

As an implementation detail, I assume many programs simply ignore the CR character already? Whilst of course many windows programs (and protocols as mentioned) still require CRLF, surely the most efficient way to make something cross-platform if to simply act on the LF part of CRLF, that way it works for both CRLF and LF line ends. The fact that both CRLF and LF used the same control character in my eyes in a huge bo…

>> instead it focuses on making people change their understanding of LF in to NL which is as unnecessary complication that will cause inevitable bikeshedding around this idea. Not really. In order to ignore CR you need to treat LF as NL.

Fair point, although I’d suggest that many programs already treat LF as NL (e.g. unix text files), so this understanding of the meaning of LF already exists in the world. If you’re writing anything generic/cross-platform, you have to be able to treat LF as NL. So there isn’t really a change to be made here.

Re: CRLF is obsolete and should be abolished

#28
post #8

SMTP https://datatracker.ietf.org/doc/html/rfc2821#section-4.1.1.... > is pretty clear that the message termination sequence is CR LF . CR LF, not LF . LF, and disagreements in this spot are known to cause problems (include undesirable message injection). But then enough alternative implementations that recognize LF . LF as well are out there, so maybe the original SMTP rules do not matter anymore.

[flagged]

Re: CRLF is obsolete and should be abolished

#29
> Even if an established protocol (HTTP, SMTP, CSV, FTP) technically requires CRLF as a line ending, do not comply. Send only NL.

Now just go pound sand. Seriously. And you owe me 5 minutes of my life wasted on reading the whole thing.

My god, I would have thought all those “simplification” ideas die off once you have 3 years of experience or more. Some people won’t learn.

P. S. Guess even the most brilliant people tend to have dumb ideas sometimes.

Re: CRLF is obsolete and should be abolished

#30

> various protocols (HTTP, SMTP, CSV) still "require" CRLF at the end of each line What would be the benefit to updating legacy protocols to just use NL? You save a handful of bits at the expense of a lot of potential bugs. HTTP/1(.1) is mostly replaced by HTTP/2 and later by now anyway. Sure, it makes sense not to require CRLF with any new protocols, but it doesn't seem worth updating legacy things. > Even if an est…

> Why intentionally introduce potential bugs for the sake of making a point?

It seems spiteful, but it strikes me as an interesting illustration of how the robustness principle could be hacked to force change. It’s a descriptivist versus prescriptivist view of standards, which is not how we typically view standards.

Post reply on HN