3 ms·
> But for that case you don't need json. A dockerfile-like text file with lines of the form I don't think that would solve any of your listed problems with jso
by maccard 2y ago
> But for that case you don't need json. A dockerfile-like text file with lines of the form
I don't think that would solve any of your listed problems with json. The key thing is that it's represented by:
struct JsonObject {
Dictionary<string, JsonObject> entries;
}
and that's the entire data structure. Your dockerfile example handles the absolute most basic of cases, e.g.
{
"foo": ["bar", "baz"]
}
would be
FOO ["bar", "baz"]
But when you nest objects .e.g.
{
"foo": {
"bar": "baz"
}
}
The dockerfile-style example is
FOO { BAR baz }
or
FOO
BAR baz # Now we're whitespace sensitive
Or maybe we're:
Foo # What do we put here?
Foo.bar baz
> Using json for such trivial stuff is like using a linear algebra library
I disagree. I think using xml for that is like using a linear algebra library, as you can have:
<Foo>Bar</Foo>
<Foo value="Bar"></Foo>
<Foo><Bar>Baz</Bar></Foo>
<Foo bar="Baz"></Foo>
<Foo><Bar value="Baz"></Bar></Foo>
and end up with the same thing. But with json, it's just:
{ "Foo": "Bar"}
and
{
"Foo": {
"Bar: "Baz"
}
}
E: Formatting