119
you are viewing a single comment's thread
view the rest of the comments
[-] semperverus@lemmy.world 9 points 1 week ago

I wish we would all start switching over to JSON for configuration files. It's so much easier to parse, and you can't screw it up with too many spaces or not enough.

[-] timbuck2themoon@sh.itjust.works 20 points 1 week ago

No thanks. Yaml isn't perfect but by God json is best used to return and parse data, not input it.

[-] tiramichu@sh.itjust.works 9 points 1 week ago* (last edited 1 week ago)

My biggest peeve with JSON when I'm forced to use it as a configuration format is that it doesn't have any syntactical support for comments.

So I can't even add any notes to the file.

[-] vinnymac@lemmy.world 2 points 1 week ago* (last edited 1 week ago)

Yea, this is a deal breaker imo. My code tends to be 10 to 1 comments to lines of code ratio. Configuration even more so.

jsonc/json5 exists for this use case, but few tools actually use it, yaml is far more popular

[-] iggy@lemmy.world 10 points 1 week ago

No support for comments? Hard pass

[-] Voroxpete@sh.itjust.works 5 points 1 week ago

Yeah, this is my biggest annoyance with JSON. As a data structure it's very elegant, but it only really makes sense to people who know how to code, and without the ability to add comments you have to rely heavily on external documentation to make it readable to most users.

[-] cravl@slrpnk.net 3 points 1 week ago

And like yeah, both the wonderful (and foss!) .json5 and Microsoft's semi-proprietary(?) .jsonc exist, but most projects just use their language's default JSON parser that doesn't recognize them. What I would personally love to see is .json5 support baked into the default JSON parsing libraries of Python, Go, etc. (Enabled by a flag, likely.) It's a superset of regular JSON and fully ES2019 compatible, so there shouldn't be any issues.

[-] Voroxpete@sh.itjust.works 7 points 1 week ago

Instead you can screw it up by having too many commas or not enough. Hardly that much of an improvement.

[-] FooBarrington@lemmy.world 3 points 1 week ago

It's IMO also so much clearer regarding data types. You can't accidentally write a boolean when you want a string.

[-] FrederikNJS@lemmy.zip 1 points 1 week ago* (last edited 1 week ago)

Why not just write your YAML files in JSON syntax?

JSON is a valid subset of YAML

this post was submitted on 14 Aug 2025
119 points (100.0% liked)

Selfhosted

50715 readers
408 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS