3 ms·
But why json? json is only marginally human-editable as its pure version doesn't even support comments. toml is way nicer for this purpose I think.
by est31 4y ago
But why json? json is only marginally human-editable as its pure version doesn't even support comments. toml is way nicer for this purpose I think.
- explaininjs 4y agoFor one, JSON has native support in the very language this runtime supports.
- fulafel 4y agoDeno has TOML in the standard library too.
- hombre_fatal 4y agoI thought TOML was nice until I tried writing a parser that handled nested tables. There's very little convergence between libraries because it's such a hard / ambiguous problem. I thought I was making good progress until I tried burntsushi's edge case test suite. It reminded me of implementing YAML. TOML is slightly nicer to write than JSON if your structure is flat, like a php.ini or Cargo.toml file. Other than that, I prefer the simplicity of JSON as well as the buy-in of JSON Schema support in apps like VS Code. We too often do this thing as craftspeople where we dramatize how much minor pain points impact our lives while ignoring the upsides.
- est31 4y agoI agree that nested data is a weak point of TOML. But writing TOML files that don't have huge levels of nesting is a charm, which would be precisely the place where php.ini, Cargo.toml and package.json operate in. Deno had the chance to innovate here, but they missed out on it.