4 ms·
JSON doesn't allow comments. So it is an ok-ish config format. Yaml would have been better. But they probably wrote everything from scratch to be optimized and
by rdtsc 11y ago
JSON doesn't allow comments. So it is an ok-ish config format. Yaml would have been better. But they probably wrote everything from scratch to be optimized and decided if they are writing a parser for a config file might as well invent a config file format as well :-)
- FooBarWidget 11y agoNginx was invented before the days of JSON and YAML...
- nkozyra 11y agoJSON, sure, but I think YAML pre-dated the launch of nginx (if not the initial development). https://groups.yahoo.com/neo/groups/sml-dev/conversations/topics/4710 https://groups.yahoo.com/neo/groups/sml-dev/conversations/to...
- FooBarWidget 11y agoYAML initial release: 2001 Nginx initial release: 2004 Well ok. But I'd still argue that Nginx was invented before the popularization of YAML. I think I didn't see YAML until I got in touch with Rails in 2007, which used the format extensively. And even then, almost everyone I met didn't take it seriously, saying that it is a joke until Microsoft, IBM, etc support it.
- CrLf 11y agoNot allowing comments doesn't make JSON an "ok-ish" config format, it makes it completely _unsuitable_ for it.
- rdtsc 11y agoBut it is used though pretty oftne. That's why it is an -ish format ;-) You can do things like { "comment": ["blah blah comment message"], "k1" : "v1", "k2" : "v2", ... } Or some silliness like that.
- samspot 11y ago{ "//This": "works though!" }