This is where the problem solving happens.

This program has been the largest project I’ve worked on so far. Most projects I’ve worked on have been small ones. Some of them have been so small, they’ve only been a few lines of code. However, no matter the size of the project, I can still find myself getting programmer’s block.

When getting stuck, I could find myself spending hours typing up a couple lines, deleting them, and trying a few more lines, and ultimately going in circles. I would eventually end up so frustrated, that I stopped following the fundamentals of being a good programmer and tried to put together anything that would stick. This left me with poorly written code, a massive headache, and quite a few bugs.

Eventually I found solutions to whatever I was trying to solve or design, but they didn’t come from continuing to stare at my screen and clacking away on my keyboard. I found my solutions by stepping away from desk and doing almost anything else. After working through my debugger on one project for more time than I cared to admit, I walked away in a huff and hopped in the shower. No more than five minutes in, I had myself a solution, and a good one at that. It was almost comical how relieved, yet annoyed I was. I had spent almost half a day pushing myself to work through this project and the second I stopped was when everything stopped becoming so confusing.

I was getting in my own way, by trying to problem solve by pushing through. We are taught to break down problems in programming until they are small enough to handle. But sometimes, it can cause you to become so micro-focused on one part, you’re not able to see there might be a bigger element that can make it simpler. You can get blocked focusing on how to fix a small part of a while loop, when a recursive function would eliminate any of the bugs you are dealing with in the first place. So if you’re stuck, take a step back, read a book for 10 minutes, take a walk around the block, and give your mind some time to wander. You might be surprised with what you come up with.

Leave a comment

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