Hacker News new | past | comments | ask | show | jobs | submit login

I can't be the only person who thinks the monumental effort spent on config formats is bike-shedding.

JSON is good enough for anything I've done. Not perfect, but no serious flaw that can't be fixed by just adding a simple app-specific post-process step that I will inevitably do for any other format anyway. JSONSchema gives us some typing sanity.

Can we just move on already to more interesting problems? It's not like git fulfills every VCS wish I've ever had either, but I have to move on. Projects and libs that introduce new config formats that continually remake the wheel, whose quirks have to be learned, are not helping my net productivity.

</rant>




> JSON is good enough for anything I've done.

I want comments in config files.


A horrible workaround I use is a blank redundant key and a leading // in my string to draw my eye to it. This only preserves the last comment in my python dictionary but I only use comments to work in the json file.

    {
        “”:”// comment here”,
        “Entry”:[-1,0,2],
        “”:”// next comment”,
        “Flag”:true
    }


And trailing commas on final list elements and object properties.


JSONC is exactly that, JSON with comments. Works fine, eg typescript’s tsconfig file is JSONC and I’ve yet to find a problem with it.



I can relate. But after using JSON for a while (in files that I edit by hand), I found that I really want comments and trailing commas (which leads to https://nigeltao.github.io/blog/2021/json-with-commas-commen...). Next I'd probably want multiline strings (leading to https://github.com/json5/json5).

But if you use those extensions, all your tooling breaks.

(Aside: I think the real bike-shedding would start when you want to add some syntax for raw string literals, e.g. heredocs; it's one of those features that feels redundant, until the day when you really need it and you can't bear the pain of repeatedly escaping and unescaping.)


> JSON is good enough for anything I've done. Not perfect, but no serious flaw that can't be fixed by just adding a simple app-specific post-process step that I will inevitably do for any other format anyway.

If someone wants JSON with extra features like comments and typingz they are better off switching to Ion.

https://amazon-ion.github.io/ion-docs/docs/spec.html


  JSON is good enough for anything I've done.
  ...
  </rant>
Except for closing comments, for that, you need XML.


Yeah, don't know why some people don't want to settle on bad formats without such basics of human economics like comments and keep improving


Given how little I deal with config files compared to the rest of my work I prefer formats that are obvious, even if verbose, to those with sneaky syntax. I'll take JSON or even XML over TOML any day.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

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

Search: