3 ms·
>> Instead we’re stuck with broken replacements like CSV. > ASCII separators are equally as broken. How do you represent a string containing the record separat
by tivert 2y ago
>> Instead we’re stuck with broken replacements like CSV.
> ASCII separators are equally as broken. How do you represent a string containing the record separator in a record-separated file?
ASCII separators may not be perfect, but they're certainly less broken than CSV. With CSV, you have the pervasive problem of how to represent a common, everyday character in the file. With ASCII separators, you only have the problem of representing an unusual, untypeable
character, which is much less troublesome.
- karmakaze 2y agoI'm happy with CSV values containing a comma being quoted and a quoted quote character being represented by doubling it (similar to SQL doubling apostrophe). I don't see what pervasive problem remains.
- Dylan16807 2y agoSo many people look at a simple spec where correct implementation is a handful of lines, and many libraries are available, and decide they'll do an incorrect one-line implementation instead. It's the temptation to just concatenate or split based on commas, or to hack a broken implementation of quotes on top, that causes so many issues.
- karmakaze 2y agoSo the problem isn't CSV the spec, it's the use of CSV without using correct library implementations. I can hardly blame that on the format itself and shouldn't be a reason to reach for something else that could also be poorly parsed with self-written code. The other extreme is YAML where the complex spec makes using any implementation is concerning.
- Dylan16807 2y agoSo many people keep messing up that at a certain point you can't just say it's their fault, there's a responsibility to guide them into better behavior. There are two main options for that. Make it so that poorly parsing with self-written code is still very likely to do the right thing, or make the parsing hard enough that people go get a library.