March 27, 2017

Solving problems, not fixing them


In software development, or whatever:
 
There is a problem.
We try to solve it. 
We finally know the cause,
a problem is solved, a bug is fixed.
 
Suppose this problem arises a second time,
and unsurprisingly, with the same cause.
We fix it quickly this time. All is good.
 
What’s wrong?
 
At this point, there will be two types of problem solvers (or coders): 
  1. Those who feels indifferent, keep fixing the same problem over and over again.
  2. Those who have the urge to solve a meta-problemhow the first problem arises and how to forever prevent this to happen again.
 
Note how I differentiate between ‘solve’ and ‘fix’ in the first and second time.
 
Let’s look at it closely:
Fixing means applying the same solution over and over again to a problem at hand.
However, solving means finding solution(s) for the problem, such that the problem doesn't ever surface again.
  
If a solution is one unit of knowledge, you only gain more knowledge through solving more problems or coming up with new solutions, not from applying the same one.
 
The second type of solver will solve more and more problems, 
and spending more time with higher-level problems (or meta-meta-… problem) than the first type.
 
In software development, examples range from improving/making new functions, classes, design patterns,
or — tools, libraries, frameworks, IDEs, 
or — paradigms, languages, or even proofs,
which we could generally view any of them as ‘solution’.
 
Finally, if you don't have the urge to solve meta-problems, you will end up learning solutions from the second type of solver anyway.

  
To sum up the two types of solvers:
 
1st type: solve!, fix, fix, fix, fix, ..., or those who satisfies with the same solution for a long time.
2nd type: solve!, solve!, solve!, solve!, ... or those who always tries to solve deeper problems and getting better at it.
 
Of course, this is oversimplified. We can’t solve problems all the time, since it requires intense mental effort. To get our work done, we fix things a lot. But it's good to take some time to think, and solve some meta-problems. Think hard about nature of a problem, build a framework out of it, and never look back.
 
Reminding myself: the next time you feel like applying same solution manually more than a couple of times (e.g., copy and paste!), know that you're fixing things, not solving. Instead, redesign classes, make libraries, automate the process, also look what others do to solve such problem. Don't repeat yourself!