Static Dependency Access
There has always been a lot of controversy over the right ways to access dependencies. Should they be injected? Located? Directly referenced? Magically resolved? Inverted? Context objects? Everyone tends to speak very dogmatically about how they think you should or shouldn’t access your dependencies. Statically accessing your dependencies is a very powerful technique. You should absolutely use it, but you must avoid its many perils.
You Must Not Admit a Single Null!
There are some principles in software development that offer benefits anywhere they are used, even in just some parts of the code. For others, they must be applied everywhere to be useful. The rule against never passing null must be applied everywhere for one major reason.
Result vs Exception
When working with business or network integrated software, errors are inevitable. It’s been compellingly argued that exceptions should not be used for control flow. It’s also critical to communicate the cause of the error and known solutions. One of the possible solutions this leads to is using a Result data structure. Let’s look at how this differs from the conventional use of exceptions.
Who Makes the Decision?
One of the biggest keys to a well-managed project is proper assignment of responsibility. Having good people on a project is not enough. The project must be correctly organized and managed so that people can succeed. At any moment, each team member should be able to give a clear and unambiguous answer when asked “Who is responsible for X?” or “Who decides what should happen in X scenario?”. If they can’t, the project will be late, over budget, and incongruous.