loading...
Cover image for Feeling stuck? Getting past the programming blockade

Feeling stuck? Getting past the programming blockade

agazaboklicka profile image Aga Zaboklicka ・3 min read

This post was originally published on my blog.

The production system broke last Tuesday...

I got a phone call last Tuesday around 8 pm. The operator told me a daily task broke in the production and I had to take care of it as soon as possible.

I turned on my laptop and connected to the customer's system. I checked the error logs and found a decent error in the file. I found the place where the exception was thrown. Then I analyzed the code in the function.And I had no idea what was the real cause of the system error. No clear bug in the code... I looked at it from every angle and couldn't find a solution.

I tried to fix it but got stuck...

And I still had no idea what was the real cause of the system error. No obvious bug in the code... I looked at it from every angle and couldn't find a solution. I got stuck.

I finally gave up. It was late and I knew we can re-run the task in the morning when I find the solution.

I logged off, talked for a moment t my little brother, made a tea... And then I knew where the problem was. I went back, checked... And it was right there, in the database!

How often do you feel stuck like this?

How often do you get stuck on writing a code to yet another feature?

You concentrate hard to find a solution to the problem. Then after a while, you're so frustrated that you decide to grab a tea and rant how a bad day you have? Or you decide to fix a bug in the different part of the software? Then after some time, you come up with a solution that makes you jump back to write code for the first problem?

The psychologists call this impression of feeling stuck an impasse. And what comes after a break is an insight.

You get stuck when you concentrate too hard

An impasse occurs when you concentrate on something too hard. It's counterintuitive. We were thought at school that to achieve something we struggle with we should try harder.

The anxiety inside you

When you're stuck you may feel it's wrong to take a break. You may think you'll lose momentum or the energy you used on solving the problem. As a result, you're getting more anxious because you can't finish the task at hand. You can even start doubting your problem-solving skills.

Take a break

It's important to take a break in times like this.

It's when you do something else that you have this 'aha' moment. Â The moment of sudden insight or discovery.

Here are some ideas to take a break without leaving the office:

  • listen to your favorite song-just listen, concentrate on the lyrics, the music, the vocalist
  • watch a youtube video with that song (or try another short video you just want to
  • write your name in few different ways
  • 5-minute meditation
  • if meditation is not an option listen to a relaxing music and concentrate on the song
  • count close your eyes and count from 300 to 200 (or similar, but backward)
  • look out the window and think what the clouds remind you of
  • go to make a tea or a coffee
  • draw what was your dream job when you were 6
  • anything you can think of, that can grab your full attention for few minutes
  • talk to the duck ;)

How do you take a break?

Let me know what work's for you in the comments. I appreciate new ideas too!

And if you got stuck take a break!

Discussion

pic
Editor guide
Collapse
martyhimmel profile image
Martin Himmel

Great advise there! I can't tell tell you how many times this has happened to me - the most recent incident being last Thursday. :)

After messing with an issue for about 45 minutes, I closed my laptop and left the office. Went out for a walk, stopped and ate lunch, then came back to the office and fixed the issue in about 10 minutes. It's amazing what taking a break and stepping away from a problem for a few minutes can do for your thought processes (and stress levels!).

Collapse
agazaboklicka profile image
Aga Zaboklicka Author

Thanks :)
And yeah, it's important for the brain to put all the hard work it did in line.

Collapse
jayellsworth profile image
Jay Ellsworth

Now that I'm 43 I finally figured out the Rubik's Cube and I find that to be a perfect little mind break. It takes all of my attention and usually around 2 minutes or so to solve.

Collapse
ben profile image
Ben Halpern

Ah this is a good idea.

Collapse
legolord208 profile image
jD91mZM2

The problem is when you're stuck because of issues in an upstream repository...

Collapse
agazaboklicka profile image
Aga Zaboklicka Author

Yeah, but that's kind of outside you and you always can move to another task for some time ;)