this post was submitted on 12 Nov 2023
751 points (96.6% liked)
Programmer Humor
19623 readers
2 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Oh god, parsing complexity. I actually tried writing a YAML parser in my free time before and boy was that not worth the headache. So many little things that complicate parsing and are ignored by majority of users!
I really like python, but I can agree that it's no-delimiters style can be... Confusing at times. I definitely had to hunt down bugs that were introduced by wrong indentation. That and the way it handles global/local variables, mostly.
I do appreciate not having to enclose every key in "", and being able to copy values - but if we want that kind of logic making our configs, why not just switch to writing configurations in Lua? It certainly has less footguns than YAML and it has the niceties like "I can just write
{key = "value"}
instead of{"key": "value"}
".Honestly that probably goes for any interpreted programming language that supports imports.
Many Javascript frameworks just put their configuration into -.config.js files in the project root. Which is a pretty elegant solution that does not require custom parsing. Just import the config and go nuts.
Compiled (and by extension bundled) software obviously requires a different approach, but at that point you should probably consider storing your config in some kind of database.
Maybe there just isn't a right answer to the config conundrum if all the general solutions are janky in some way.
Well, there's a few things I personally think are a must for a config format: