June 10, 2008

Posted by John

Tagged programming and thoughts

Older: What's the IP For?

Newer: A Class Instance Variable Update

Programmers Should Give Up More Often

You know that feeling? The one where you are in the zone. Every keystroke is intentional and the sound of them in succession sounds almost like music. Your chair feels comfy and your desk is clean, or at least mostly clean. The code you are producing could be framed and put on a wall and even your mom would admire its beauty. You’ve had that feeling right?

Contrast what I just presented, with that other feeling. You know it. I know you know it. You have a slight buzz in the front of your brain. Typos begin to abound and you are starting to think your fingers went drinking without you. You shift to and fro but your chair continues to feel like a block of wood. Your code is so convoluted that you sometimes don’t understand what you just wrote 30 minutes ago. In fact, the thing that should “just work” isn’t working and hasn’t been for the past 45 minutes.

What To Do?

So what are you to do? Push through you say! Mush, mush! I know in an hour I’ll once again feel fresh and write code that sounds like a harp from the Heavens. I’ve already spent 45 minutes, what’s another 15. Besides, I’m so close. FAIL! I have news for you Walter Cronkite, you won’t. Your code will begin to feel more and more like the spaghetti [insert previous language here] you use to write. You’ll get more uncomfortable, and most likely the buzz in your head will last for hours after you stop, quite possibly ruining the rest of your night.

Great Programming Requires Inspiration

I believe the ability to give up and to know when to give up is what sets great programmers apart from good, average and poor ones. Programming is art. Art is created through inspiration. Anyone can push through and churn out crappy code. The question is, are you self-aware to the point that you know when it’s time to stop?

Do Something Else

Next time you feel the buzz creeping into the front of your skull and your undies start riding up, stop! As the wait staff at Logan’s Roadhouse says, “Stop what you’re doin and swallow what you’re chewin.” Pet your cat. Read a few chapters from a book. Complete the next mission on Grand Theft Auto. Don’t push through. Do something other than programming that inspires you and I guarantee the inspiration for what you were working on will return.

What I Do

So what do I do when I hit the wall? I’ve never been much of a reader but lately I’ve turned to books. I’m not a fan of fiction, but I have discovered an ardent interest in business, especially now that I’m a business owner. Books like Good to Great, The Fred Factor, 4 Hour Work Week and Blink are inspiring me to think differently and write better code.

9 Comments

  1. Greg Woydnilek Greg Woydnilek

    Jun 10, 2008

    Compare and contrast
    http://contemplativeprog.blogspot.com/2005/04/interview-on-contemplative-programming.html

  2. I agree with this 100%. Usually, when I just can’t seem to make any progress I do a quick “git stash f_this” and grab a beer :)

  3. Nice tip to remember and helped me a lot. Recently I context switch to cooking, flushes my buffer :)

  4. @Trevor – Awesome! Great use of git stash.

    @Kiran – A solid choice. I haven’t got into cooking much but I do like eating. :)

  5. The last time i overwhelmed (i totaly couldn’t remember the code that i wrote one hour ago, and reverted it dramatically..) watching old series of the Spaced 1 saved my soul. :)

    1: http://www.spaced-out.org.uk

  6. Lately, a successful move for me has been switching mediums more then stopping programming. I leave the computer and the code and either just lay in bed or go outside with a pen and paper. I stop the hacking mode desperation and refocus the good programming vibes, and figure out my programming problems with out my fingertips and keyboard. When I go back to the code, I feel refreshed and full of clarity about the task at hand. Highly suggested.

  7. @William – Good point. I often break out my moleskin when I get tired and put my ideas together there first.

  8. I think, washing the dishes is perfect for these situations. ;) (that’s why I don’t have a dishwasher)

    But: all this is works pretty well for freelancers. But what, if you are an employee and you have to write code?

  9. @humpaaa: “What if you’re an employee?”

    It’s actually very simple: Just create a meeting and invite a few people. You can chat, point with a stick, eat donuts etc. :)

    There are companies where people spend %90 of their time in meetings – just imagine how creative they get after a while! ;)

Sorry, comments are closed for this article to ease the burden of pruning spam.

About

Authored by John Nunemaker (Noo-neh-maker), a programmer who has fallen deeply in love with Ruby. Learn More.

Projects

Flipper
Release your software more often with fewer problems.
Flip your features.