x00-separated values
-
-
@aliceif What's the wrapping format? Actual NULs are illegal in both HTML and XML…
-
@dkf XML
-
@aliceif Well, that just sucks. Any conforming parser should have a shitfit over that, as NUL is not a character that is valid in any rule.
Change
ListData
to contain the base64-encoded version instead.
-
@dkf said in x00-separated values:
Actual NULs are illegal in both HTML and XML…
And comments are illegal in JSON. But who cares? They're all application-specific formats never to be used outside anyway.
-
Null-delimited values. That'sNULLaNULLnewNULLone.
-
That's amazing!
-
@Gąska said in x00-separated values:
And comments are illegal in JSON. But who cares?
The people who have to consume your JSON and whose JSON parser is standard-compliant. If you're building a public API and returning JSON with comments, you're an asshole that requires me to manually parse the response and remove the comments.
-
@Sumireko said in x00-separated values:
Null-delimited values. That'sNULLaNULLnewNULLone.
Paging @Groaner ...
-
@asdf said in x00-separated values:
If you're building a public API and returning JSON with comments, you're an asshole that requires me to manually parse the response and remove the comments.
Parsing JSON isn't that hard, even with comments, but if the API says JSON, there are no comments. There are however people who store data in JSON, and they tend to think: "Hey, a text file, I can add a comment to that!" I kid you not. It's of course better than csv, but anything is better than csv.
-
@Hanzo A configuration file needs comments. But pure JSON is a bit hard on the hand-editing for configuration anyway. And interchange doesn't have any business carrying comments.
-
@PleegWat said in x00-separated values:
A configuration file needs comments.
That's why you should use YAML for configuration files. JSON is almost as inappropriate as XML for that use case.
-
@Hanzo said in x00-separated values:
There are however people who store data in JSON, and they tend to think: "Hey, a text file, I can add a comment to that!"
If they use a
"@comment"
member of the object, it'll even work… Well, sort-of work…
-
@asdf Where are
sudoers
and.ini
files on that scale?
-
@aliceif One a scale of 0 to 10, sudoers is somewhere at +INF * . Especially since you're not warned if you accidentally forget to use visudo and fuck up your whole system because of a typo.
.ini
files are on the same level as JSON IMO. If you like them for some reason, consider using TOML.
-
@PleegWat said in x00-separated values:
And interchange doesn't have any business carrying comments.
And yet, for some strange reason, we keep making our programs generate a bunch of magic byte arrays in unicode format, with quotation marks and commas and other symbols all sprinkled around in them, compress them, and send them to another program, to then do the reverse process (which is even more complex) and get the original data.
-
@asdf said in x00-separated values:
The people who have to consume your JSON and whose JSON parser is standard-compliant.
Ahem...
@Gąska said in x00-separated values:
They're all application-specific formats never to be used outside anyway.
If generic JSON parser doesn't work with my file, too bad! Either they have to accomodate to our file format, or we have to accomodate to their parser. It's the exact same situation as with proprietary, binary formats, except XML and JSON are industry standards for defining text formats and there are ready-made solutions for the boring part of input parsing.
-
@anonymous234 Of our two bulk data interchange formats, one is newline-separated-records/tab-separated-fields, and the other is binary reclength-(tag-length-value)*. Both are then gzipped, and both can only reasonably be consumed through helper tools.
-
@anonymous234 said in x00-separated values:
And yet, for some strange reason, we keep making our programs generate a bunch of magic byte arrays in unicode format, with quotation marks and commas and other symbols all sprinkled around in them, compress them, and send them to another program, to then do the reverse process (which is even more complex) and get the original data.
Often skipping the middle two steps.
-
@Gąska said in x00-separated values:
Often skipping the middle two steps.
Ah yes, just today I had to explain to one of our Chinese developers that I want configuration parsed once when it's read, not on every data record processed.
-
Why not just �?