DEV Community

Cover image for 7 Ways to Clear Your Head When Facing a Programming Problem

7 Ways to Clear Your Head When Facing a Programming Problem

Drew Town on July 15, 2019

Everybody has encountered it, the programming problem that makes NO sense. This problem has no fix, it just cannot be done. Then all of a sudden,...
Collapse
 
fischgeek profile image
fischgeek

Good article. I usually turn to Rubber Duck Programming myself. Sometimes, my wife plays the part of the Duck. She just sits there silently with a vacant expression and a slight smile. Usually I'll get a part where I found I goofed and I'll stop talking and turn back to my screen. She'll then kiss me on the forehead and walk away. Love that woman.

Collapse
 
drewtownchi profile image
Drew Town

Ha! That's sweet. I'll find I normally get a similar response or a "I have no idea what you just said but I hope I helped"

Collapse
 
fischgeek profile image
fischgeek

Hahaha! Yep! I've heard that too!

Collapse
 
bradtaniguchi profile image
Brad

I love rubber duck programming, works great!

Collapse
 
peiche profile image
Paul

"Go for a walk" is my go-to response to getting stuck. I work in an office, so I take a walk around the building, get a drink of water, and often the mindless activity of taking my mind off my work will help to shake loose some ideas. :)

Collapse
 
meshcloud3d profile image
Noah Hornberger

After stopping working and taking a walk, I try to find another 'frame' to help me understand the dataflow in the situation. Sometimes I think of 'roads with traffic' or 'items on store shelves with a mad shop owner looking for expired goods' or whatever fits the problem. Then I think of solutions as if this was a physical problem. Then ideas get flowing and I can find an angle to tackle the programming. Even if its rough and the solution changes, it still helps get things going to put the problem into another frame and think of it that way.

Collapse
 
amosaidoo profile image
Papa Kwesi

Sleep is really important. When I sleep late, mostly the next day is wasted.

Collapse
 
classyk12 profile image
Classyk

It's really fun getting stuck sometimes lol and I hope I'm not sounding weird but I anticipate those times. Drew was right in my mind, everything he listed here is what I do except one thing, I grab a drink and it helps too sometimes.

Collapse
 
lexiebkm profile image
Alexander B.K.

Push-up ?? No, it only takes out my energy, although it makes my upper arm muscle larger/harder. After doing push-up, I feel I lose my energy pretty much, and cannot think well.
High quality meal is much better, as it gives energy rather than taking the energy out of my body.

Collapse
 
elrichie profile image
Moses

Taking a walk or watching something funny works like magic for me. It relaxes and reinvigorates you.

Collapse
 
rudywowrack profile image
Rudy

Taking the focus out of the 'persisted' problem have helped me alot. Taking a shower, eating and watching Friends then come back to the problem, and bam suddenly the solution is right there

Collapse
 
kevinhch profile image
Kevin

"if you have a problem, just leave it" this what i learnd in this post

Collapse
 
oman profile image
O

I actually do all of these. I can’t tell you how right you are about sleep. I can finish something in so much less time in the morning that was giving me trouble the day before.

Collapse
 
stilldreaming1 profile image
still-dreaming-1

Take a shower break.

Collapse
 
gwllmnn profile image
Grégoire Willmann

Definitely talking about it!
(if you can) with a coworker helps almost every time

Collapse
 
davidasync profile image
David Async

Find distraction is works for me :)

Collapse
 
oviemikael profile image
Awotoruvie Ovie Mike

Great tips, thanks, I totally agree with all said. Up until now, I've been adopting method 7 and it's worked all the time, I'll adopt other methods as well.