Forgive me for maybe a noob question. I am reading much about configuration – maybe this in Elixir is one of the most confusing things? I read this Configuring your Elixir Application at Runtime with Vapor | AppSignal Blog and it says “if it can be set at runtime, it should be set at runtime.” This makes much sense to me – this is how other languages work with
.env files – but maybe the comparison is not fair with dynamic languages?
My question is what things can not be runtime config? I imagine a very simple setup from working with PHP where there was only 1 config and 2
.env files (regular
.env and a
.test.env) and the test suite would know to use the
.test.env. But dynamic languages do not have the same concerns. I am thinking maybe a config for a module name like saying which HTTP client the app should use. A system ENV maybe has string for “HTTPoison”, but you must convert this to atom like
Elixir.HTTPoison. It is ugly, but I think this works fine. What things will not work this way and must be set in a config file for compile time config?
Thank you for your replies!