4 ms·
Oh, that is pretty cool. I didn't know about json5. This would also be quite nice for config files. Regular json is not nice for config files due to lack of com
by olavk 9y ago
Oh, that is pretty cool. I didn't know about json5. This would also be quite nice for config files. Regular json is not nice for config files due to lack of comments.
Json5 is still not as "editable" as it looks though. You need to separate values with comma (except the last value), so there is more syntactic noise. So you get:
{
size: {width:100, height:100 /*yay*/},
}
This is not an issue when the text is machine-generated (as Json typically is), but is an issue when it is edited by hand as config files often is.
- anentropic 9y agoYAML is nicer still for config files
- olavk 9y agoYeah, nicer to read and write. More complex to parse though. S-expressions are incredibly simple to parse. But I guess every language have a YAML-parser these days.
- akvadrako 9y agoI do prefer to write YAML, but the complexity is so bad every parser in every language is broken: http://matrix.yaml.io http://matrix.yaml.io
- anentropic 9y agobut for config you can stick to a self-documented subset of YAML that works so in practice you don't notice any brokenness it's not like a web browser that has to work on a diversity of third party sources I'm not even sure how to read that matrix anyway, and it does say: > The YAML Test Suite currently targets YAML Version 1.2. ... some frameworks implement 1.1 or 1.0 only
- akvadrako 9y agoWhat's the point in using YAML if you're using an ad-hoc subset!?