Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

But why JSON and not CSV [1]? Most of what the article suggests, like formatting the output as lines and flattening, is how CSV works. CSV is much easier to parse than JSON (use split(",") or the equivalent). A complete record (JSON object) of CSV data can be parsed in a single line, unlike typical JSON. The line-based nature of CSV makes it far more fault tolerant to broken streams/truncation and more in-line with standard Unix conventions.

[1] https://en.wikipedia.org/wiki/Comma-separated_values



Nested objects? JSON holds json fine, with arbitrary depth, retaining ability to print pretty and parse. Not sure how that’s going to work with csv


A) Csv isn't actually a standard, so there's no one universal way of dealing with it (we can get really close).

B) the keys and values are disjointed in csv as separate rows/columns, vs key:value

C) yes flat is better but when you need nested, nested is useful


One of my values contains a literal ,




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: