Your first solution for a problem won’t be the best one.
The first thing you need to do when trying to solve a problem is research existing solutions for the given problem because most of the time someone else already solved a similar one and after having a list of possible solutions you should filter them based on your needs.
A problem always has more than one solution, so finding the best solution is an optimization problem that needs your evaluation, to better decide consider checking the score of your solution. The optimum choice should take into consideration how much time/resources and energy you need to research and implement it.
Having some requirements helps you cut off some alternatives. Once you have a set of minimal solutions it’s important to validate them in small proof of concepts. It will help you understand the tradeoffs in practice and improve your understanding. Finally, when two or more solutions are tied, you should choose the simplest one.
If you want to use this solution in a production system with a team, you have some more steps to follow. You need to ensure you can deliver this solution incrementally without breaking anything. You also need to write an RFC and demo your solution to your team, to make sure everybody is on board. Other people can find problems in your proposed solution and edge cases that you have not thought about it, making you need to reevaluate your approach.
Summary
Finding the best solution for a given problem takes some time as you need to evaluate many options before deciding. Picking the first one or the “best practice” or most used solution could not be the best solution for your problem and requirements.
Team members can invalidate your proposed solution and help you reach a better solution. Adding a solution for a production running system can be more challenging and require tweaks.
If you liked this article and my newsletter you should sponsor me at my Patreon, where I also provide mentorship for developers.
If you want some help to find the best solutions for your problems send me a DM or a public tweet for @sseraphini