if (problem == solved) { write_the_code() }

Posted by in Thought

if (problem == solved) { 

The above title is a quote which i have used at couple of places. People often joke around it saying that when the problem is solved, why do you need to write the code. True, but I have a different approach of seeing a problem and coding.
Coding is indeed meant for solving the problem but is it really the code which solves the problem?
For me the answer is “no”, Coding is just mere implementation of the real solution which is technically called algorithm. When I refer the word algorithms things like parsing, searching, DFS, etc. click in ones mind, but algorithm is not limited to this or predefined structure, any piece of logic implemented in computers is algorithm.
According to wiki Algorithm is
“In mathematics and computer science, an algorithm is a step-by-step procedure for calculations. Algorithms are used for calculation, data processing, and automated reasoning.”

When I say if problem == solved, I mean that when you are ready with your algorithm, you know what you have to do then you are good to go and write the code. The code can be any language from javascript to go. But the solution irrespective of the code is going to remain same.