2 ms·
I appreciate the discussion, and I'm sorry I have to respectfully disagree :) > I think using flat file human-readable serialization for relational data is the
by jstimpfle 11y ago
I appreciate the discussion, and I'm sorry I have to respectfully disagree :)
> I think using flat file human-readable serialization for relational data is the real kludge, but I guess that's just me.
Look into your /etc and tell me which of the files in there are a kludge, and which ones are not plain text relational (or key/value, for that matter).
> newlines in your data
Well, what I do is I split at newlines :). Very practical since it guarantees fields don't contain them. (In the rare cases where
you want them, do percent-encoding, hex encoding, C string style, whatever).
> encoding inconsistencies
Parse at an abstract character level of your choice. In scripting languages you get basic Unicode sanity for free. In C I would not want to deal with Unicode. It's too big for my head. UTF-8 goes out of its way so I can ignore it (newlines etc. still work). C strings means no longer having to deal with painful questions like "is c.isspace() only for U+0020 or for also other characters in Unicode classes which I never even heard of (or which don't even exist yet)?". ASCII/C locale text fits in my head. I don't want to be concerned with more abstraction (~ additional semantic baggage) throughout most of a system.
> delimiters in your data
same as above.
> you never know what you're going to want to feed into it in the future.
You better have a rough idea. I don't see why you couldn't commit to non-whitespace user-ids now, for example. Conversely, if you don't want to enforce sensible constraints now, you end up with code which never quite knows what it can assume (and often it can not assume properties that are needed for a sensible implementation).
> To me, the usual way to provide that is with an application and not a data format.
Can I email that application to someone else? Can I grep it as easily as my text files? Can I version-control it? Can I quickly whip up a script, import the application into Excel or maybe sqlite and visualize or extract some relationships? Will that application server still serve my data in 10 years? Will that application still build next year? How do I access it when I don't have a stable connection?