One of the things that distinguish a junior developer from an experienced one is the ability to explain the decisions he has made in detail. That allows making sure that the solution is thought through, and there is no coincidence in it working as desired.
I’d like to point out that we don’t talk about the outcome of the decision, either good or bad, because many variables may affect it. We talk about the arrangement process itself and why and how we should make mindful decisions. That way, we can make the most out of it and eventually expect a better result.
Advantages of mindful decisions.
Properly based decisions increase the possibility of creating reliable solutions. Still, I believe the more important aspect is that with reason on your side, you may gain considerable experience regardless of the outcome of your present solution. When you make your choices attentively, whether you prevail or fail, it is much more beneficial to learn from your mistakes and do better next time. So, when it comes to watchful decision-making, it is all about your reliability and fast progress.
One simple heuristic to learn whether your understanding of a given solution is comprehensive enough is to imagine a code review done by a very skeptical reviewer (btw. I believe that is usually a good one to have). Then, whenever you reach a significant part, imagine you are being asked “Why?”. If you feel that your answer may not be satisfactory, then probably there is some gap in your understating of the subject. Thus, the decision was not fully knowledgeable.
How to make mindful decisions?
I believe there are two elements of deciding with reason. The first is to remember to think about the alternatives. You don’t always have to find any. Sometimes that’s not possible, but consider this point anyway. You want to protect yourself from a situation where you choose something without the chance to compare it. Usually, there are two or more ways to proceed, and you need to find them to choose well. The second element is a continuation of the former. When you recognize your options and pick your favorite, take some time to compare it with all your alternatives. That comparison is to make sure you picked correctly and did not skip any vital aspects of your decision-making. As I mentioned before, it is more about explaining your call and defending it with arguments when the time comes.
What we are trying to avoid here are excuses often made by inexperienced programmers. If you find that your argument supporting your choice sounds similar to one of the sentences below, that should be a red flag.
“This is the first solution I found or considered.” — Even if you chose correctly, you will look unprofessional answering questions related to alternative solutions.
“I do not quite understand the code.” — Sometimes copy-pasting is good enough and speeds up the work, but sometimes it is not and prevents you from seeing the whole picture.
“I do not quite understand the alternative.” — When you do not see the differences, you are unable to make an educated decision.
Try hard and be critical of the code you read and write. Have your arguments ready and be professional.
Is the decision mindful enough?
The last thing when it comes to pragmatic decision-making is the cost of deciding. Sometimes, it is just not worth it to consider any alternative at all, whether it is small, unimportant stuff or an element that you can ponder upon when you finish — we may refer to it as deferring premature optimization. However, when you feel that the aspect is essential and you should spend some time to make sure it is right, you may find yourself in a situation where it is crucial to choose the right amount of diligence.
On the one end of the spectrum, you have the prospect of considering no alternatives at all. On the other end, you have the option to consider all possible alternatives in detail. Of course, it takes time, and time is money, so you should be realistic to make it cost-effective.
Obviously, I won’t tell you what to do, you are the programmer after all, and you are the one responsible here, but I can tell you that the amount of care varies and it varies by a lot. Decide how much attention you need:
- Take into consideration the importance of the given decision and the time you have.
- Remember about premature optimization and the most critical aspects that are vital to your project.
- Don’t hesitate to state that something is too expensive even to consider and that you are good enough with what you have right now.
Make decisions with reason on your side. Good luck!