3 ms·
Every year this question comes up, and every year the arguments are the same. It's an exercise in hubris because while CSV has one glaring fault, it is far few
by SavantIdiot 5y ago
Every year this question comes up, and every year the arguments are the same.
It's an exercise in hubris because while CSV has one glaring fault, it is far fewer than other competing methods of the simplest possible exchange of textual data.
No one can decide to retire CSV because it ubiquitous. Of the three issues OP compains about: line delimiter, field delimiter, and header, only one is really a problem for anyone that has used them for any period of time.
1. Every file format suffers from Windows/NonWindows CRLF issues.
2. Metadata has been an issue since forever, and there are plenty of painful formats that support it (looking at you XML), complete with ginormous parsers and even more issues.
3. Escaping, as OP points out, was pretty clearly defined in RFC 4180.
So yes, it has a wart: escaping.
Learn what your system expects, and modify accordingly. Because using a CSV will be much faster and simpler than any other format you can try, which is why it has been so pervasive for longer than most of HN has been alive.