How Can You Overcoming Mental Roadblocks When Writing Code?

Programming can be as fulfilling an experience as it is frustrating. While you might have all the tools and design patterns in the world, sometimes a problem can seem unsolvable, or the solution too complex and lengthy to implement and anxiety quickly builds. So what do you do when your brain gives out at a critical coding juncture?

Image: Rachel Johnson / Flickr, licensed under Creative Commons 2.0

The issue is better known as becoming “stuck” — a situation where you find yourself staring at your screen, wasting precious minutes, hours and even days on the same class or subroutine and getting nowhere.

As Alumnify CEO Aj Agrawal points out, dealing with this indecision is not something taught as part of a Computer Science degree, leaving new developers without the mental tools to move on:

Books, online tutorials, and group classroom-style training don’t teach as effectively as mentorship. These resources cannot tailor an individual student’s learning. They don’t teach students how to ask the right questions or how to break down complex problems and think about them in different ways. And they aren’t good at keeping students on track, accountable, and motivated.

Agrawal shares a few basic suggestions for getting “unstuck”, such as describing the problem aloud, taking a break or even just hitting Stack Overflow. Personally, I find working on a related system (though something separate is fine, too) can help get the gears moving again, or help foster a new approach.

Going for a walk has also proved beneficial — a great idea now the weather is improving — and if you have the good fortune of working from home, even the white noise of a warm shower can wash the mental dirt away with the physical.

Why the Hardest Part of Coding Is Getting Unstuck [Inc.]


The Cheapest NBN 50 Plans

Here are the cheapest plans available for Australia’s most popular NBN speed tier.

At Lifehacker, we independently select and write about stuff we love and think you'll like too. We have affiliate and advertising partnerships, which means we may collect a share of sales or other compensation from the links on this page. BTW – prices are accurate and items in stock at the time of posting.

Comments