4 ms·
One benefit of binary formats is not needing the escaping.
by zzo38computer 2y ago
One benefit of binary formats is not needing the escaping.
- LegionMammal978 2y agoLength-delimited binary formats do not need escaping. But the usual "ASCII Delimited Text" proposal just uses two unprintable bytes as record and line separators, and the signalling is all in-band. This means that records must not contain either of those two bytes, or else the format of the table will be corrupted. And unless you're producing the data yourself, this means you have to sanitize the data before adding it, and have a policy for how to respond to invalid data. But maintaining a proper sanitization layer has historically been finicky: just look at all the XSS vulnerabilities out there. If you're creating a binary format, you can easily design it to hold arbitrary data without escaping. But just taking a text format and swapping out the delimiters does not achieve this goal.
- immibis 2y agoAt least you don't need these values in your data, unlike the comma, which shows up in human-written text. If you do need these values in your data, then don't use them as delimiters. Something the industry has stopped doing, but maybe should do again, is restricting characters that can appear in data. "The first name must not contain a record separator" is a quite reasonable restriction. Even Elon Musk's next kid won't be able to violate that restriction.
- zzo38computer 2y agoI did mean length-delimited binary formats (rather than ASCII formats).
- oever 2y agoHear hear! Why is all editing done with text-based editors where humans can make syntax errors. Is it about job security?