News for hackers. Stuff that matters.
Re:YAML: Probably not so great after all by bagasme on Thursday September 28, 2023 @08:18PM (#37697747)
After I digged into related articles on the link, it seems like the holy grail to the config files dilemma is to just hard-code desired settings in the source code. However, it also means that users (especially using binary packages) are stuck with settings from the distro.

If you truly needs user-configurable setting, maybe TOML is for you.

Re:YAML: Probably not so great after all by __blockcipher__ on Thursday September 28, 2023 @08:23PM (#37697786)
> it seems like the holy grail to the config files dilemma is to just hard-code desired settings in the source code

That is…not remotely the holy grail. You’re really throwing out the baby with the bathwater on that one. User-configurable settings are important for many, many applications.

In the narrow case that you’re working on, say, a monorepo for closed-source code that only runs on your own servers, maybe in source code is fine provided there’s no host-level differences that would require a config file.

But for any other circumstance…yeah you need some type of configurability.

Re:YAML: Probably not so great after all by amluto on Thursday September 28, 2023 @11:43PM (#37699040)
Even with a single company closed source monorepo, sometimes it’s useful to change settings without a restart and redeploy. And sometimes one runs more than one instance of the same code.
Re:YAML: Probably not so great after all by deepsun on Friday September 29, 2023 @02:50AM (#37700136)
Why not both? You can write config-looking Kotlin code so that user won't even realize it's Kotlin. But type-safe and with auto-completion.

Something like

    server {
      port = 8080
      addr = "127.0.0.1"
      development = true
    }
    
    db {
      url = $DB_URL
      user = "app"
      password = include(".secrets/dbpass.txt")
    }
Re:YAML: Probably not so great after all by atoav on Friday September 29, 2023 @04:40AM (#37700931)
[delayed]
Re:YAML: Probably not so great after all by Lutger on Friday September 29, 2023 @05:55AM (#37701434)
Not sure if I would call hardcoded settings in the sourcecode configuration - they are just constants. The primary benefit of configuration is the ability of changing the behavior of software without having to rebuild, redeploy, redistribute or even restart. Either by the user or by the developer or sysadmin, depending on context.