What Is Programming? How Programming Is Equivalent to Real-Life Activities
In my Programming Language post, I have explained Programming Language is a way we use to communicate with computers. In this post, I will show you how we actually communicate with computers and how equivalent it is with Real-life activities.
“Programming is problem-solving” — Prof. David J. Malan
A brief overview
Every day in our life consists of many problems that need to be solved. They might be how to solve a difficult math exercise, or even a simple problem such as how to cook a delicious meal for your family, etc. These examples have one thing in common. We have to prepare everything needed and go through a sequence of steps in a specific context with a specific set of tools to accomplish the goal, to solve a problem per se. Programming which needs a fresh mind, and a laptop to go through a sequence of steps trying to make computers do what we asked it to do using a programming language to solve a problem is not an exception. How we solve a problem by following a sequence of steps to accomplish the goal which is called Algorithm
A deeper look
Let’s take a real-life example like the cook-fried-chicken example and go through every single step. Firstly, we need to buy chicken, flour, and breadcrumbs. Next, in the kitchen (we cannot cook in the bedroom, which is why the kitchen is our context here), we follow the recipe in a logical sequence
- Use a big knife not a small knife because it is hard enough to chop chicken
- Marinate the chicken, and impregnate the chicken with flour and breadcrumbs
- Fry the chopped marinated impregnated chicken
Finally, we have a delicious fried chicken. The fry-a-chicken problem is solved
- Write code to display two input fields
- Write code to take those input and multiply them
- Write code to display the computed result
Finally, the result is displayed on the monitor. The multiplication problem is solved
At the first look, we might see that programming is that a man sits in front of the laptop doing some magical colorful texting but the essence of it is problem-solving. Even that do-some-magical-colorful-texting guy is trying to solve his problem. Therefore, as Steve Jobs said, everyone should learn how to program because it teaches them how to think.