4 ms·
The configuration examples are not valid JSON, due to trailing commas. Not a great first impression. https://github.com/runreveal/kawa#getting-started https://g
by fl0ki 3y ago
The configuration examples are not valid JSON, due to trailing commas. Not a great first impression. https://github.com/runreveal/kawa#getting-started https://github.com/runreveal/kawa#getting-started
I see it's because they use their own config loader library that uses hujson. Why even use the human-unfriendly JSON format if you're also going to make it machine-unfriendly by not conforming? If nothing else, why not at least acknowledge that in the documentation which still calls it JSON? If this is what Grug Brained development looks like, they can keep it.
- ejcx 3y agoThe json parsing library that parses the config file allows either syntax. That was intentional since we get in the habit as go programmers of ending lines in structs/maps with commas, it's just for convenience.
- fl0ki 3y agoSerious question though, why use "JSON" at all then? You can just admit it's JWCC, which is fine, at least that's a distinct term -- but even that's not a spec, it's just a blog post that very few people even know about. Even that same blog post endorses using TOML, the spec generally preferred for things that may need to be human-edited. It meets humans half-way a lot better than even JWCC, which is the kind of practicality I think even Grug would prefer. https://nigeltao.github.io/blog/2021/json-with-commas-comments.html#why-not-toml-instead https://nigeltao.github.io/blog/2021/json-with-commas-commen... And while we're at it: https://www.arp242.net/json-config.html https://www.arp242.net/json-config.html https://dzone.com/articles/why-json-isnt-a-good-configuration-language https://dzone.com/articles/why-json-isnt-a-good-configuratio... https://revelry.co/insights/development/json-configuration-file-format/ https://revelry.co/insights/development/json-configuration-f...