The Struggle of Logic Building: to Solve a Real Problem

I didn’t know when you choose the path of teaching a computer what you want, there would come a day where I’d get stuck on how to actually solve a problem.

Building a calculator was easy. But then my teacher said to create a rectangular using asterisks (*). Hehe, I know, it’s that old, bore way teachers use to teach students. But it was worth it. That is when I realized the importance of loop and if. You have to use your brain to create logic on when an asterisk should be placed and when to break that loop.

My Secret: The Dry Run

I am not here to tell you how to create a rectangular with an asterisk—that is too long. But I will tell you a secret I used as a teenager to get good at programming: The Dry Run.

Put the computer away. Look at a copy and start to write the problem. Write the situation on when that problem can be solved.

Like if I want a rectangular, I have to start at the end and display 5 asterisks. How is that possible? It is possible if my loop runs 5 times and then breaks. But… again, I want it to run 4 times in the second run. How can that happen? Then you think: I have to use a static value which will decrease on each run. See? I bet you are starting to build logic here.

Why Old Times were Better

That dry run logic still helps me a lot today when I get stuck on a problem. In today’s world, I see students just putting up a prompt like “I want a facebook app” and AI builds it for them.

But this way, they never learn how to actually own what you build. That was the beauty of the old times, you treasure what you build because you struggled for it. That is the dedication missing in today’s youth.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *