Dear developers,
Please don't use JSON for configuration files. It is intended for carrying data, and nothing else. Therefore, it is good at carrying data, and nothing else.

I strongly believe that anything that doesn't support comments shouldn't be used for configs. Comments are indispensable for short documentation, or putting a URL to proper documentation.

There are other plain text file formats better fit for this purpose, such as TOML, YAML, and even XML.

If you coded your program in JS, I understand that you might be inclined to use JSON. Maybe you want to reduce bloat or dependency by not including a TOML or YAML parser. But you are making it more difficult for us to contribute to your project, or fix something on our end.

It is quiet old too. Probably older than time itself given that it doesn't support date standards ISO 8601 or RFC 3339 out-of-the-box. That is because it doesn't need to, because it is not for configurations or manifests.

What is your favourite plain text format for configurations?
JSON
14.9%
TOML
34.9%
YAML
32%
Other (comment please)
18.3%
Poll ended at .

@murtezayesil I'd say that depends on several things.

The one thing I was assuming was that I need to write and maintain the config file as a human. For that, I find TOML quite easy to write and read.

If your config files are (auto-)generated and read only by software, it really doesn't matter at all as long as it follows one standard IMO.

@publicvoit True to some degree. If config is auto generated, my local changes could get overwritten. I mean why not embrace Window's central registry like system in Linux. It is an industry standard.
But if software is telling me where the default config file is for advanced configuration, allowing me to set the path for its config file in its limited settings page or through CLI, there is a good chance this is not one of those cases.

@murtezayesil

> Window's central registry [...] It is an industry standard.

I'm not sure if this is standardized.

And: not every pattern is a sane way of doing things. Particularly when it comes from Microsoft. I can give you *lots* of examples where they did the most stupidest things where nobody is able to follow their reasoning. 🤷

@publicvoit Standard unfortunately doesn't always mean sane or smart way of doing things. That is because if enough people are doing something same way, it becomes a standard.
My point is that we should use raise awareness for using standards for the purposes they were meant to serve. Purpose of JSON is to carry data between server and client. A JSON file should die after carrying that data. Using it as a config file is stretching its purpose at best, and making configuring impossible at worst.

@murtezayesil I subscribe to your message.

> My point is that we should use raise awareness for using standards for the purposes they were meant to serve.

However, this would also "prevent" or "suppress" creative ways of (re-)using technology which is also an important aspect.

So unless there is an issue related, I would not stick to "this is how it was meant to be" without a good reason.