this post was submitted on 24 Jan 2026
52 points (94.8% liked)

Programming

24607 readers
184 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 !webdev@programming.dev



founded 2 years ago
MODERATORS
 

There exists a peculiar amnesia in software engineering regarding XML. Mention it in most circles and you will receive knowing smiles, dismissive waves, the sort of patronizing acknowledgment reserved for technologies deemed passé. "Oh, XML," they say, as if the very syllables carry the weight of obsolescence. "We use JSON now. Much cleaner."

you are viewing a single comment's thread
view the rest of the comments
[–] MonkderVierte@lemmy.zip 7 points 1 day ago (3 children)

Except config files. Please don't do config files in json.

[–] Diplomjodler3@lemmy.world 2 points 1 day ago (1 children)

Why not? It works great in Python.

[–] MonkderVierte@lemmy.zip 3 points 1 day ago (2 children)

Not on the human parser side.

[–] Tanoh@lemmy.world 3 points 1 day ago (1 children)

And no comments, unless you use a non-standard parser. But then you might as well use anorher format.

[–] Diplomjodler3@lemmy.world 4 points 1 day ago* (last edited 1 day ago) (3 children)
{"comment": "Who says you can't do comments in JSON?"}
[–] bleistift2@sopuli.xyz 2 points 22 hours ago

This only works if the software that consumes the JSON doesn’t validate it or ignores keys it doesn’t recognize (which is bad, IMHO).

[–] tyler@programming.dev -1 points 15 hours ago (1 children)
[–] Diplomjodler3@lemmy.world 3 points 14 hours ago
{"comment2": "I can do this all day."}
[–] abbadon420@sh.itjust.works 3 points 1 day ago

Lol. That works, but its hacky.

The meaning of a "comment" is an integrated language feauture to write something that is not parsed by that language. This is just regular JSON.

[–] atzanteol@sh.itjust.works 1 points 1 day ago (1 children)

JSON is super easy to read and write though. Just needs a parser that allows comments...

[–] tyler@programming.dev 1 points 15 hours ago (1 children)
[–] atzanteol@sh.itjust.works 1 points 14 hours ago

Yes, which needs to be supported by your parser.

[–] abbadon420@sh.itjust.works 2 points 1 day ago (2 children)
[–] Lysergid@lemmy.ml 1 points 4 hours ago (1 children)

Yaml is dogshit format. If you need tree-like structure use json if you need list of props use toml or simple key value pairs. I fucking hate app properties in yaml.

  • can’t search shit
  • copy-paste doesn’t “just work” when you want to merge two files
  • your editor doesn’t show whitespaces and you messed up somewhere - valid but incorrect
  • messed up formatting your list of banned IPs/hosts/ports/users/subnets/commands - get pwned

It should’ve never left the basement of crackhead who thought “let’s make schema-less format depend on number of invisible characters”.

I’ll rather save my data in Copybook and record it on tape then use this Python-bastardized abomination

[–] abbadon420@sh.itjust.works 0 points 4 hours ago (1 children)

Oh nice! I didn'tknow toml, so I looked it up a bit. Atfirst I was like "this is just .properties with a better typing support". Than I saw the tables and the inline tables, which is a really neat way for complex nesting. It reminds me of json, but better. I'll see if I can start using this somewhere.

[–] bookmeat@lemmynsfw.com 1 points 39 minutes ago

Meanwhile, XML crying in the corner.... 😄

[–] atzanteol@sh.itjust.works 6 points 1 day ago

Fuck yaml. TOML or literally anything else.

[–] neukenindekeuken@sh.itjust.works 0 points 1 day ago (1 children)

Json configs read much cleaner to me since .net swapped to them a while back.

Xml is incredibly verbose when there's a 12k loc web.config.xml

[–] MonkderVierte@lemmy.zip 1 points 1 day ago* (last edited 1 day ago) (1 children)

Then do a cfg or ini style config or make multiple config files. YAML/TOML if you can't make it simpler. The neccessity for complex config formats is a fuckup of the dev.

[–] neukenindekeuken@sh.itjust.works 2 points 18 hours ago (1 children)

Or you work in an environment that's still using Full Framework and ASP.NET Webforms.

These places exist, and they are unfortunately not rare.

[–] MonkderVierte@lemmy.zip 2 points 18 hours ago (1 children)
[–] neukenindekeuken@sh.itjust.works 1 points 51 minutes ago

Heh, thank you. It's usually not so bad, but figuring our all the assembly redirects needed is always a nightmare job.

Can't wait until this this is on .net 8+ and we can use clean configs.