“Although practicality beats purity.”
– from the Zen of Python
What started off as a step toward alleviating excessive journaling of temporary data structures in our system, ended up exposing a handful of cases where they were actually used for persistent data. When we made the switch within our data base environments to turn off journaling on this set, some of these data structures disappeared unexpectedly. Once we realized what had happened, the only course of action was to search the code base for these data structures, restore their data, and rename them so they would be permanent memory again.
In order to fix this, we were scanning the code bases of over 100 clients. Given the sheer volume of code to (manually) review, nothing beyond a quick and dirty fix was really practical in order to minimize the impact. In some cases, there were better long term solutions than a simple restore and rename. However, as much as I wanted to spend time investigating potential longer term fixes, the priority was just to restore any missing data, rename the temp structures to be permanent, and get everything running smoothly again. I had to remind myself that sometimes practicality beats purity.
The above line from the zen of python reminded me that you always need a mechanism to prevent yourself from getting stuck in an unproductive (or infinite) loop. Be mindful of your priorities and the results you are aiming to accomplish. I know I tend to put a significant amount of energy into figuring out what the best possible solution is for a particular problem, sometimes at the cost of over thinking it. Building software isn’t about getting it right from the beginning, it’s about being able to assess what is most important right now vs what can wait, and being flexible enough to change your priorities as the situation warrants.