Day 28

Andrew
1 min readMay 20, 2021

Don’t write dodo-code.

Sometimes code will rely on values that are subject to change after the program has started executing. Different environments, different customers, all situations leading to different values.

These values are configurable, and so should be store outside of the application. Since they’re so critical to the configuration of the program, it makes sense to store them in a separate configuration (AKA config) file.

Most of the time, this is done through a “static file”: a file or database which is read by the program each time new configuration details are required.

In the passage today, an argument was made for dynamic configuration instead:
“Without external configuration, your code is not as adaptable or flexible as it could be. Is this a bad thing? Well, out here in the real world, species that don’t adapt die.”

This implies that configuration files should be separate enough that they are accessed within a program, rather than being tightly coupled within. By registering for config updates, whenever the values change, the code no longer has to be rebuilt.

Keep the configurable stuff configurable, but keep everything adaptable above all.

Thank you for reading, see you tomorrow!
#PathToSWE

--

--