Hacker News new | ask | show | jobs
by forrestthewoods 17 days ago
Your entire framing is wrong imho.

Multi-platform is very easy and a solved problem if you try juuuust a tiny amount.

For example the Rust stdlib iterator for lines() handles both conventions. It just works. Very easy.

I live in a cross-platform world. Line endings in text files should not be a breaking problem because some CLI tool refuses to support both. That’s just plain bad software engineering.

I expect Unix tools that process text files to be capable of supporting text files that have different conventions. This is very easy. Refer to previous comments on stubbornness out of spite.

1 comments

Even Python has str.splitlines, which accepts a range of line separators (not just LF and CRLF), and the same when iterating over a file handle (which iterates over lines).

You're right, this is a complete nonissue.