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.”


Except config files. Please don’t do config files in json.
Yaml
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.
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
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.
Meanwhile, XML crying in the corner… 😄
Fuck yaml. TOML or literally anything else.
Why not? It works great in Python.
Not on the human parser side.
And no comments, unless you use a non-standard parser. But then you might as well use anorher format.
Now do a second comment.
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.
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).
JSON is super easy to read and write though. Just needs a parser that allows comments…
That’s JSON5 or JSONC
Yes, which needs to be supported by your parser.
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
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.
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.
My condolences.
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.