How Practice Helps When Learning How to Code

Photo by Brett Jordan on Unsplash

“Okay now let’s do integrals.”

I was in 7th grade and tried to ask my dad what a derivative was. I didn’t really know how it got to this point but it was nothing new.

I would always ask my father for help if I had a math or physics question I couldn’t understand, which would then lead to a study session lasting at least a few hours and going off on many wild tangents about other problems, whether or not I wanted it to. At the end of every study session, he would always tell me I needed to solve more problems. But if I had just learned all the material I needed, what was the point? Fortunately, I decided to listen to his advice anyway.

While the idea of practice made sense to me, I never truly understood it’s necessity until I became a tutor myself in those same subjects. I was good at math and physics, but had never really thought about why. The students I tutored could grasp the concepts and understand them, but this would not always translate to solving problems. A problem could have multiple facets and challenges that the students may not have seen before, and they would sometimes end up getting lost in that maze.

Photo by Susan Yin on Unsplash

Coding problems can be seen the same way. A new problem is a new maze, and you must find your way to the end by utilizing what you know, but you can never be sure you’re on the right path. It is very easy to get confused when solving a problem. Syntax errors can force you to backtrack, new functions or elements can make you feel lost, and an overall lack of knowledge can make you feel like you’re at a dead end. But when things finally start to work and those problems get solved, it feels like you’re finally on your way out. But every time you find a new challenge when coding, you fall into that foreign maze again.

When you see a problem you’ve solved before though, you’ve been dropped in a maze that looks familiar to you. The path to the exit lights up from past experiences, and now you can walk on the path that you found the first time you made your way out of that maze. Being able to see the path that you’ve struggled on before invokes a sense of nostalgia and excitement. Instead of being lost, you know every turn you need to take, and have seen the dead ends before. That practice and hard work finally bears fruit.

Thanks to my father’s advice, I’ve learned the way out of thousands math and physics mazes. I preach the importance of solving all kinds of problems to my students, and continue to follow that practice as I code as well.