Hacker News new | ask | show | jobs
by _dain_ 1284 days ago
>CSV is superior to JSON for tabular data

Can't you just do this?

  {
    "columns": ["col1", "col2", "col3"],
    "data": [
               [1,      2,      3],
               [4,      5,      6],
               [7,      8,      9]
    ]
  }
That's valid JSON but it's human-readable and human-editable rows of comma-separated data, just like CSV.
1 comments

You can. But I don't see how that is superior to the equivalent CSV.
Until you try to either cram it into Excel, work with different encodings or pass it around different software platforms (even your lang vs JS), no difference.

CSV has been abused a lot to make it work on conflicting use-cases, JSON handles a lot of misshaps happened with delimiter-separated record formats, like new-lines or bring-your-own-character encoding.