CSVs Are Kinda Bad. DSVs Are Kinda Good
matthodges.com
CSVs Are Kinda Bad. DSVs Are Kinda Good
1–10 of 133 posts
Re: CSVs Are Kinda Bad. DSVs Are Kinda Good
#2Re: CSVs Are Kinda Bad. DSVs Are Kinda Good
#3It's less code for you and you can do neat things like zstd compression on the columns.
Bonus, it also doesn't require that you load and unload everything in memory.
Re: CSVs Are Kinda Bad. DSVs Are Kinda Good
#4Re: CSVs Are Kinda Bad. DSVs Are Kinda Good
#5The intent of the format is to be human readable and editable. Sure, Tab characters can be used instead of commas. (TSV files) Yes that's that "" to escape a quote rule. Oh and quoted values are optional, unquoted strings are fine as long as they contain no newline or record separator characters.
Sure, you could make another CSV inspired format which uses the old mainframe control characters; except as keeps getting pointed out, even programmers often don't know how to enter raw flow control characters on their systems. Who even bashes those out these days? I know I have to look it up every time.
Rejoice that the format is so simple, it's all just text which software might convert to numbers or other values as it might desire.
Re: CSVs Are Kinda Bad. DSVs Are Kinda Good
#6And if you are in control of producing data, just produce strict RFC 4180-compliant CSV data and everybody will be able to read it just fine. There is no need to make your reader’s lives difficult by using yet another non-standard data format.
See also: https://news.ycombinator.com/item?id=39679753>
Re: CSVs Are Kinda Bad. DSVs Are Kinda Good
#7Also, I’m on a mobile right now, so can’t verify that, but it seems the format is flawed. The reader decodes UTF8 strings after splitting the binary buffer by the delimiter, but I believe the delimiter may be a part of a UTF8 character.
Edit: just checked and there’s actually no chance that the delimiter the author chose would be part of UTF8 encoding of any other character than the delimiter itself
Re: CSVs Are Kinda Bad. DSVs Are Kinda Good
#8Re: CSVs Are Kinda Bad. DSVs Are Kinda Good
#9I can't tell you how many times I've downloaded a CSV that didn't escape quotes or newlines correctly, or how many times Excel has failed to correctly parse a perfectly valid CSV due to some decades-old quirk.
I know that there are better formats that make these types of situations pop up less, but is a little bit of quality control too much to ask for? If you've tested your software to make sure that it can handle CSVs with line breaks, tabs, and both types of quotes, then you've seemingly done more testing than 90% of the software out there.
On that note, the LibreOffice Calc team deserves major credit for how many different CSV formats it can handle. It's saved my bacon so many times when Excel wasn't up to the task.