On coding
When you write code, you work on multiple levels. The problem you are trying to solve, the method or logic you have in your head to solve it, the structure of that logic into modules, functions etc., You keep iterating across these until you start to see the results.
As you test, you may find many possibilities that you did not think before. You begin to patch the code for new possibilities and the original thought process (the problem, the logic to solve it, the structure) in your head gets messed up. It becomes harder and harder to debug and patch it up as your mind has to also retain the new possibilities.
Get Thalapathy Krishnamurthy’s stories in your inbox
Join Medium for free to get updates from this writer.
This is when you must relook the problem itself with the new constraints that you learnt and relook at the solution and if necessary rewrite the code. Even if it means a completely new thinking from where you began.
The more you write code for the same problem as the different aspects of the problem becomes clear, the more you uncover the problem itself and the practice you have had by then writing the same logic in many iterations help you to solve the actual problem in a simpler manner.
This is the case with algorithmic coding than engineering coding. Algorithms try to solve a broader set of problems that are similar with a succinct code. Our mind needs practice to get used to the problem space, the solution, the structuring of the code etc. with iterations. Over time, it is almost like driving a car, were you start looking around and finding better ways to reach a destination than worrying about handling the wheel.





