Why do so many tools have JSON config files?

This note from textlog.cc explores the ubiquity of JSON configuration files in modern development tools. It questions why JSON, despite its lack of comments and strict syntax, has become the default choice for configuration, and touches on the trade-offs between human readability, machine parsing, and ecosystem support.

Why do so many tools have JSON config files?
  1. raincole

    > Why do so many tools have JSON config files‽ Commenting why options have been set the way they have is just such a basic thing to want to do… Why do tech people have such an aversion to writing things down⁇

    That's the whole post. First I don't know why this is posted on HN. Second I don't see how "JSON config" and "writing things down" are the two opposite options.

  2. szatkus

    > A lot of tech folks resist documentation because they think it provides them with job security.

    No, we're just lazy.

  3. gwbas1c

    > Why do so many tools have JSON config files‽

    1: Because JSON is a very easy serialization format to work with. I suspect these tools all have configuration classes / objects that are deserialized straight from the config file.

    2: I suspect a lot of these tools are written in Javascript, and in Javascript JSON is very easy to work with.

  4. mholt

    For Caddy we chose JSON because it's fairly universal, maps nearly 1:1 with Go structs (useful for initializing an extensible server), and nearly everything else compiles to JSON one way or another, so you can choose your own config format, really: https://caddyserver.com/docs/config-adapters

  5. zzo38computer

    In my opinion, JSON is not the best format and has some problems. Lack of comments is one of the reasons, as they mention in there. Another is the lack of trailing commas (optional trailing commas would be useful for manually written files). However, these are problems with the syntax, and there are also problems with the data, such as a lack of a proper integer type, lack of Infinity and NaN, lack of support for character sets other than Unicode (and ASCII), lack of proper octet string type, etc.

More from this day

2026-09-02