3 ms·
Programming language as config is bad because it makes it easy to do the wrong thing (too much power). Friction can be good. Ideally, the less power, the bette
by d0mine 2y ago
Programming language as config is bad because it makes it easy to do the wrong thing (too much power). Friction can be good.
Ideally, the less power, the better:
- .env :: simple flat untyped key/value pairs. In practice, something like Pydantic can introduce hierarchy and type validation for the config
- json :: simple, few data types. Can be read/written by humans
- toml :: easier to edit by humans
- json5 :: not in Python stdlib
- yaml :: may require discipline, to avoid turing tarpit
As an intermediate between pure config and programming languages, jsonnet language can be used to generate json.
Turing complete: Ruby, Python, Lua, Lisp, etc — avoid for simple configs. They can be used as extension languages/ DSL