5 ms·
We’ve discussed this at length and I’m squarely in the DO NOT camp. The drawbacks of using non-readable meta characters exceeds the benefits: 1. TSV can be rea
by dev_dull 7y ago
We’ve discussed this at length and I’m squarely in the DO NOT camp. The drawbacks of using non-readable meta characters exceeds the benefits:
1. TSV can be read and imported by almost everything.
2. People can add and adjust TSV files from any editor.
3. What’s the way to insert meta characters again In VIM? And now nano? Argh I’ll just try and copy and paste it. Ugh that doesn’t work.
Just use CSV/TSV folks. Anything more complicated and reach for a better serialization format (json, yaml) and not a better delimiter.
- cbsmith 7y agoLike a lot of things, #1 is only partly true, particularly if you have embedded tabs. The number of times I've had to deal with parsing errors because of embedded carriage returns, commas, tabs, etc., sometimes costing millions of dollars is just... upsetting. It's like JSON... we say everything can parse it, but really what we've got is some approximation that will come back to haunt us... and once you've done all the work to make sure everything is precise and correct, you'd really have saved time if you'd just used the tools we already had in the first place.
- cbsmith 7y ago2. More accurately, people can screw up TSV files from any editor. Have you not seen embedded spaces used instead of tabs and totally mess everyone up?
- cbsmith 7y ago3. If you don't know how to use your editor, maybe you should learn. If your editor can't insert even all the characters in basic ASCII, it's not an editor.
- dev_dull 7y agoGo ahead and give every engineer who comes across your meta-delimited file a little rundown on how it works. "Can you show me how to import it into google sheets?" "I need to email it to someone, can you show me how to change it?" "My IDE says I need a plugin to read it? Do you know anything about that? Can you help me set it up?" They'll all agree how clever and useful the meta characters are of course, but only after you've given them your time in learning about it. No thanks no thanks no thanks. For me I'd rather deal with a little bit of serialization headache then a support headache.
- cbsmith 7y ago...and this is why we can't have nice things.
- Annatar 7y agoBoth JSON and YAML are very difficult to construct parsers for. To make matters worse, both formats are full of pitfalls: http://seriot.ch/parsing_json.php http://seriot.ch/parsing_json.php https://arp242.net/yaml-config.html https://arp242.net/yaml-config.html using either of these, in my opinion, is extremely misguided.
- dev_dull 7y agoThe flip side to that is that json and yaml parsers exist in every language, and would be more than capable of replacing any logic you’d find in a CSV.
- Annatar 7y agoCSV's are a data structure. They do not contain any logic.
- chucksmash 7y agoCan't find a source for it now, but one of the design goals of JSON iirc was that it should be easy to parse. You should have a go at writing a JSON parser to convince yourself it isn't hard. Can manually lex it in less than 150 lines of Python.
- tinus_hn 7y agoJust use these formats if you want to be stuck in the last century when internationalization was that odd thing you could easily afford to ignore. Otherwise, use a real format.