Some thoughts on building software
- For http services, instrument trace ids asap. New requests should either generate a randomized trace uid and store it in context or inherit one from a header
- Always set up structured logging so that you can index and query by various properties
- Set up global exception handling
- Set up testing asap, even if project is early stage, it is easier to build for testing from the start rather than cobbling afterwards when there are possible roadblocks like global state, singletons, brittle interfaces and dependencies.
- The higher up the callstack, the more abstraction and declarative a component should be. For example, things written inside the main() should be high level and semantic. More specific code can be more imperative, but it helps to have readability from the top of the program so that the big picture/taxonomy of components is readily apparent.
- Unix philosophy is paramount and applies to many other contexts
- Database migration on start up is a simple way of tac