4 ms·
Urgh, I was nodding away until I reached guide 16. Although the idea it expresses is fine, their example of parsing CSV files yourself is a terrible one, especi
by kelnage 8y ago
Urgh, I was nodding away until I reached guide 16. Although the idea it expresses is fine, their example of parsing CSV files yourself is a terrible one, especially since they link to a previous article where they anticipate some issues that can be encountered when parsing CSVs, but ignore the legion of others (different separators, quotation characters etc).
If you’re going to parse a CSV file, please, just use a standard library for your language - please don’t just split on commas and call it done. The only case where it might be acceptable to do it yourself is if you have complete control of the input - but that would to me imply a static data that could be added to the code base instead of a CSV file.