3 ms·
You opted for JSON for configuring your project. I've seen other people do that, but the problem is most interpreters don't support comments (because comments a
by GhotiFish 14y ago
You opted for JSON for configuring your project. I've seen other people do that, but the problem is most interpreters don't support comments (because comments arn't part of json) and even if you have really_verbose_names_with_underlines_for_spaces, sometimes you just can't get away without comments.
YAML, I think, is better suited for configuration files.
Disclaimer: This is a minor criticism.
- glenjamin 14y agoDepending on how strict the interpreter of the JSON is, you can often get away with using unexpected keys - something like: { "//comment": "default = 0", "godMode": 1 }
- mattspitz 14y agoThanks for the thought. I wanted to use something like YAML but I didn't want to introduce an unnecessary dependency. Upon further review, I probably could have used a vanilla .ini file and ConfigParser (http://docs.python.org/2/library/configparser.html http://docs.python.org/2/library/configparser.html) It's a built-in module and .ini supports comments.
- notaddicted 14y ago(not OP) I personally like using regular python for python project config files (like django does.) If you want to keep it simple, it will be simple, if you want to do something fancy you have the whole language.