3 ms·
So much JSON... is that the real thing, as in comments are the gateway to hell, or is it actually some practical JSON superset like JSON5? I almost see myself
by usrusr 3y ago
So much JSON... is that the real thing, as in comments are the gateway to hell, or is it actually some practical JSON superset like JSON5?
I almost see myself jury-rigging some bespoke filesystem on-ramp to that REST configuration interface. Likely with at least half a dozen scary security compromises.
Then on the other hand I guess they've never been afraid of getting called opinionated and that's certainly much better than trying to be everything, for everyone, at the same time.
- gjvc 3y agoJSON without comments is hell, forcing one to 1) convert JSON configuration to YAML. 2) add comments to YAML and admire it. 3) convert YAML to JSON for sending to the server.
- coldtea 3y agoYAML is an order of magnitude more hell...
- johnchristopher 3y agoBut TOML is worse, right ? I can't write nor read TOML to save my life... :(
- rascul 3y agoTOML is much simpler in general but it does have its warts. It's basically just key = "value" pairs in [sections] for the simple stuff.
- coldtea 3y agoI think it's saner, but still has some bizarre design choices
- TheFlyingFish 3y agoThis is just my personal opinion, but I think YAML is more intuitive but has a lot more footguns and gotchas, while TOML is more consistent but less obvious (ironically, given the name.) This may contribute to YAML's popularity in CI systems, because CI systems often need to be adjusted by someone who isn't super familiar with the syntax, and YAML is easier to intuit than TOML.
- sethammons 3y agoI literally cannot count the number of times significant whitespace has broken a yaml file I've edited followed by a completely useless error on line 1. I don't have this problem in python. I loath yaml.
- usrusr 3y agoFortunately it's only forcing one to convert to a JSON variant that does not forbid comments (starting as simple as wrapping the entire thing in console.log JSON.stringify). I'll happily leave the YAML authoring to YAML inventors, supposedly it makes them happy.
- dekobon 3y agoIt isn't documented, but if I recall correctly UNIT supports JSON with comments.
- otterley 3y agoI like to think of JSON as a low-level configuration language that most people should generate from a higher-level language such as Python or JSONnet — sort of like assembly is to C. JSON has lots of things to like about it, but I don’t recommend generating it manually for most people for files larger than a few lines.