Content

Finding the best solution and not just any solution (programming)

Page is part of Articles in which you can submit an article

written by owen on 2017-May-21.

related image

I was reading a TDD article this morning and had a few thoughts on the idea of "Find the best solution and not a solution" as it relates to programming. I will detail these thoughts below;

There might be no best solution

Before one sets off on a journey one must always recognize that they may be wasting their time and worse even wasting the time of other people. There might be no "best" solution or no solution at all to the problem you are trying to solve. Keeping this idea in the back of your mind will give you perspective and objectivity.

The best solution has a negative cost benefit ratio

New programmers either fall into the category of trusting too much in their platform or google search. If they read a article somewhere that says "you can go to the moon if your dev stack is properly configured" some might take it as fact that such a thing is possible using pure software or A.I neural networks. Always do a cost benefit analysis on any solutions you propose. It does not matter how hard you work or how diligent you are because the road to hell is paved with good intentions. Spend time, do your research. Time is money and money is time. A programmer's time is not infinte and you will not be young forever.

Be wary of side effects

Say you have come up on an idea solution which not may be best but is adequate in solving the problem within the constraints of the time you have; it is juvenile to not spend an equal amount of time to understand the negative aspects of the approach that you choose. The more projects you work on the experience you will gain and the more you will learn. But you should not rush blindly into a solution without understanding what side-effects may or may not occur. I have see many projects run for years and get totally re-factored in a weekend because little bugs were overlooked because they found a quick-fix for a big problem (they spent 2 years building on top of this quick fix).

Risk management and fire fighting

You might take the approach to run with a solution irregardless of what side-effects may popup in the future. However this technique requires someone very skilled at fire fighting problems. When someone spends all their time putting out fires, they look very busy, and they have a great sense of purpose. You will have to be prepared do what is necessary to keep the so called "house of cards" system that you have built up running no matter what happens. This is possible if you are immortal but most people are not.

Conclusion

At the end of the day there is no way you can come to a solution without carefully weighing your options and brainstorming. There is no best solution that can solve every problem in every situation - concessions must be made. If someone says they have the best without knowing all the angles then they are either lying or selling something or both. Be aware of buzzwords, design patterns, edge case solutions, flashy presentations and overly simple demonstrations. The sooner you get to the hard stuff the sooner you can weed out the bad solutions.

permanent link. Find similar posts in Articles.

comments

    Comment list is empty. You should totally be the first to Post your comments on this article.


comment