2 ms·
I like CSV for the same reasons I like INI files. It's simple, text based, and there's no typing encoded in the format, it's just strings. You don't need a libr
by account-5 2y ago
I like CSV for the same reasons I like INI files. It's simple, text based, and there's no typing encoded in the format, it's just strings. You don't need a library.
They're not without their drawbacks, like no official standards etc, but they do their job well.
I will be bookmarking this like I have the ini critique of toml: https://github.com/madmurphy/libconfini/wiki/An-INI-critique-of-TOML https://github.com/madmurphy/libconfini/wiki/An-INI-critique...
I think the first line of the toml critique applies to CSV: it's a federation of dialects.
- deepsun 2y agoSimilarly I had once loved the schemaless datastorages. They are so much simpler! Until I worked quite a bit with them and realized that there's always schema in the data, otherwise it's just random noise. The question is who maintains the schema, you or a dbms. Re. formats -- the usefulness comes from features (like format enforcing). E.g. you may skip .ini at all and just go with lines on text files, but somewhere you still need to convert those lines to your data, there's no way around it, the question is who's going to do that (and report sane error messages).
- nukem222 2y agoSchemaless can be accomplished with well-formed formats like json, xml, yaml, toml, etc. from the producer side these are roughly equivalent interfaces. There's zero upside to using CSVs except to comfort your customer. Or maybe you have centered importing of CSVs into your actual business, in which case you should probably not exist.
- nukem222 2y ago> It's simple My experience has indicated the exact opposite. CSVs are the only "structured" format nobody can claim to parse 100% (ok probably not true thinking about html etc, just take this as hyperbole.) Just use a well-specified format and save your brain-cells. Occasionally, we must work with people who can only export to csv. This does not imply csv is a reasonable way to represent data compared to other options.
- PaulHoule 2y agoThe HTML 5 spec says exactly how you're supposed to deal with broken HTML files.
- nukem222 2y agoYes, that is a single spec with correspondingly-small importance. Generally parsing html remains extremely difficult.
- kibwen 2y agoIt's of quite large importance, and despite being difficult, it is well-specified, which is the point here. Importantly, there is also no competing HTML spec, either de facto or otherwise. CSV doesn't have anything of comparable authority.
- kokada 2y ago> CSVs are the only "structured" format nobody can claim to parse 100% You don't need to though since in most cases you just need to support whatever CSV format the tool you're handling, unless of course you're trying to write the next Excel/Google Sheets competitor.