Hacker News new | ask | show | jobs
by GTP 959 days ago
If your program doesn't have a way of reloading its configuration at runtime, then even that first object created by reading the configuration from file can be immutable.
1 comments

Yep! What I mean, though, is that the loading function itself will need to mutate the object as it reads settings from disk and updates the in-memory data structure. Once that's done, you can pass that around as a read-only object.