Hacker News new | ask | show | jobs
by ryan_j_naughton 688 days ago
Eh, I'm skeptical of this statement.

CVS is explicitly about tabular data. JSON (including JSON5) is much more flexible. Flexibility can be great but also can be annoying. If you want tabular data, then a system that enables nesting isn't great.

2 comments

I love jsonlines but csvs are way more compact, since you don't have to repeat the column name for every line of data
I think the fact that a human can mostly just read csvs is an important part of their adoption, too.
You would write JSON arrays without names for tabular data. I don’t know if there is a standard way to do the header, but array of names would work. Or JSON Schema record.
Rather than highlighting flexibility as the differentiator, I would say: CSV is for dense data, JSON is for sparse data. They are flexible in different ways. For example, CSV is very flexible when renaming a column title.