Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What is wrong with JSON? Everything already supports it.

JSON has two drawbacks: a lack of comments (although you could add "#" keys in relevant places) and no binary support (arbitrary conventions include base64) but this doesn't support binary anyway.



A few issues (although I do use JSON in config):

It isn't a friendly form of human input. My error rate is 50%+ , you have to lint on save to catch things that are invisible to the naked eye

No ability to override, extend or reference keys. This is most useful in config objects where for eg. in a dev object you want to override the username and password for a database connection but not repeat all the other parameters

No comments


You can override in pretty much the same way TOML does. Instead of replacing an underlying object, you update it with the values read from JSON.


Lack of comments is pretty much a deal breaker for configuration. I see a lot of undocumented JSON used for configuration and I find it difficult to believe that is something we want for the future.

Lack of comments makes JSON much better for data exchange than formats with comments.


Lack of comments is at once annoying and beneficial: it forces your [JSON-based] configuration to be simple.


Like xcode project files...


couldn't you just use JS Object notation? you get comments, less cruft (having to quote string definitions in the key-space might be annoying).

Am I missing something with that?


What is the difference between "JS Object notation" and JSON? Google searches show they are the same thing. JSON definitely does not have comments http://www.json.org/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: