43
submitted 1 year ago by [email protected] to c/[email protected]
you are viewing a single comment's thread
view the rest of the comments
[-] [email protected] 9 points 1 year ago* (last edited 1 year ago)

Every time I have reached for TOML I have ended up using JSON. The first reason is that Python standard library can read but not write TOML, which is generally useless for me. The second reason is TOML does not add any benefit over JSON. It’s not that much easier to read and IMO JSON is easier to write by hand because the syntax rules are completely obvious.

[-] [email protected] 19 points 1 year ago

TOML is mainly for humans to write, certainly not a good choice if you're programmatically writing files - comments and formatting would be lost.

[-] [email protected] 2 points 1 year ago* (last edited 1 year ago)

Agreed. Except that it’s not easier to write imo

[-] [email protected] 6 points 1 year ago

The very first moment that I had to use JSON as a configuration format, and I was desperate to find a way to make a long string into a JSON field. JSON is great for many things, but it's not good at all for a configuration format where you need users to make it pretty, and need features like comments or multi-line strings (because you don't want to fix a merge conflict in a 400 character-wide line).

load more comments (15 replies)
load more comments (16 replies)
load more comments (16 replies)
this post was submitted on 01 Feb 2024
43 points (86.4% liked)

Programming

21420 readers
373 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 2 years ago
MODERATORS