Post #2953780
2026-03-25 11:02 UTC
Some library that has a (20 mins of grepping and spelunking in python libs ...)
`self.base_url: str = base_url or os.getenv('PROXY_URL', 'http://localhost:4000')`
Or a class that does `constructor(timeout:number=2000)`
Or the settings.rs that has
`let dir = std::env::var("DIR_VAR").unwrap_or_else(|_| "/etc/foo/".to_string());`
I very much prefer expliciness.
Replies (1)
-
@berkes@mastodon.nl 2026-03-25 11:02
* Offer a .env.example, compose.yml or settings.json with all those defaults set. Keep them out of the codebase. Keep them together in one place. * Document all settings. AI agents are well suited to create/update that conf.md from your code+config files * Let the app crash on startup when values are missing. Privide good errors instead of silent defaults * Also let it crash for invalid (out of range, wrong type) values.