3 ms·
Having worked with a bit of YAML, RAML,(which is a superset of YAML) and JSON style configs/schemas... I'd take JSON over YAML if only because it seems to be mo
by to11mtm 7y ago
Having worked with a bit of YAML, RAML,(which is a superset of YAML) and JSON style configs/schemas... I'd take JSON over YAML if only because it seems to be more expressive.
Still, everyone forgets HOCON [1] is a thing, which solves many of the problems expressed here about JSON -for configuration-. It's easy to clearly specify things like time, reference other parts of the config, or if you want to change just one value, you can add that to the 'end' of the HOCON file and be GTG.
[1] - https://github.com/lightbend/config/blob/master/HOCON.md https://github.com/lightbend/config/blob/master/HOCON.md
- styfle 7y agoI’ll have to find something wrong with HOCON and add it to my list :) https://twitter.com/styfle/status/1237182409239658500 https://twitter.com/styfle/status/1237182409239658500
- iainmerrick 7y agoHOCON is meant to be a friendlier JSON, looks like? At first glance, it has some nice ideas but takes it way too far -- just the table of contents on that repo looks longer than a summary of JSON in its entirety. Skimming through it, concatenation of unquoted values is where it goes off the rails for me. This is quite the gotcha: https://github.com/lightbend/config/blob/master/HOCON.md#note-arrays-without-commas-or-newlines https://github.com/lightbend/config/blob/master/HOCON.md#not... My wishlist for a friendlier JSON would be, in priority order: - Allow trailing commas - Comments - Allow newlines instead of commas - Allow unquoted dictionary keys And I think that’s it. I’m not even sure the last one is worth the extra complexity.