Hacker News new | ask | show | jobs
by cannonpalms 879 days ago
Restricting config to static values removes quite a bit of the value of config, in my opinion.

Yes, logic should live in code, but very often that logic needs to behave differently depending on some piece of (inherently variable, not static) configuration.

Random examples (written from the perspective of personified code): - How many threads should I use? - On which port should I serve metrics? - Which retry strategy should I use?

1 comments

By "more static", I meant items with only a handful of variations.

If you're using one port for dev & another for prod I reckon it's best to have it in config.

But if you're port is varying by image, region, dev/test/prod status and has exceptions for customers using your app on prem then keeping all that logic in code may be easier.