I have great motivation at the start of a project, but if I get to a dull task, or if the project drags on too long, I really struggle to get going. I'm terribly lazy at the best of times, so this question really goes out to anyone who is of a similar personality:

How do you motivate yourself to get on with a dull coding task?

+6  A: 

I'm looking for the same answer myself.

Browsing through stackoverflow hasn't helped so far...

+1  A: 

There were some interesting responses here you might find helpful (I posted a different-but-in-some-ways-related question a few days ago).

+2  A: 

Break it up into small mechanical tasks, get some caffeine and execute the tasks like a robot. Trying to look at the problem from my supervisor's point of view also helps.

+9  A: 

I try to break the larger project into smaller manageable tasks. And then I try and find new and creative ways to accomplish them. Basically I look at each piece of the task as an opportunity to do a better job and improve my skills. With that mindset I can stay focused even on long dull projects.

+3  A: 

There is nothing I find more motivating than telling myself during those bouts of severe laziness where I am given to more likely procrastinate than get the work done that the quicker I am done with it, the sooner I may get to work on exciting stuff.

+2  A: 

I find that stopping work on the big task, and doing work on some other trivial tasks, that take only 10 - 15 minutes can help. They act like a 'cigarette break' but because you are still working, you don't feel like you are slacking off. And if you complete an easy unrelated task, this can help motivate you to go back to work on the main task, because you feel like you have been achieving something.

Tim C
+4  A: 

I try and force myself off the internet. If I manage and just get started I find I can carry on with a productive day. If not, and I start surfing, the day's gone.

Mladen Mihajlovic
arg! so true!!!!
Magnus Smith

Doing things differently.

I read somewhere, "Great people do things differently than doing different things".

"Insanity: doing the same thing over and over again and expecting different results." - Albert Einstein
+1  A: 

Take short interesting tasks between the dull tasks. Those interesting tasks can be project related or personal (games, writing blog, food, family, exercise, walk, music)

Usually that results in lots of games and no code. :)

I take a line from the Tao.

"The difficult is born in the easy"

Basically means that the only reason something is hard/boring is because we know what easy/exciting is. Just imagine yourself never knowing what easy is, and the task becomes, a task.

This takes time to learn stuff like this, and to be able to control your mind, thoughts, etc, but its a great boon to myself to be able think this way now.

And if none of this works just blast the music!


I like the ideas people suggested about using other tasks as a reward (even if it was a work-related task) to get you doing a dull task. Sadly that still takes motivation!!

Fast music helps a bit I think.

I realise my most productive times can be when the router breaks down and I can't get on the net!

The best way I have found is to keep my boss very well informed about what I am doing, so I can easily feel he'd know if I was slacking. The guilt then gets me working.

Magnus Smith
+2  A: 

Sometimes I create artificial challenges to keep myself motivated and focused. I reward myself for meeting them. Examples:

  • Put some chocolate on my desk, eat it if I complete Task x before leaving for the day.
  • Get a particular function working correctly in < 3 compiles.
  • Entertain yourself with unusual (but appropriate) variable names.
  • Talk to someone about it. Get another idea, run an algorithm by a coworker, finish it and show an appreciative peer how clever you were.
  • Try to optimize something as you code: speed, size, format, comments. But don't sacrifice maintainability.
  • Add a harmless "Easter egg" that will make you smile w/o affecting the end result.
  • Negotiate for Friday afternoon off if you complete certain tasks ahead of time.
Adam Liss

One thing that I find that works for me is having a BIG, interesting but not completely work related project at hand. For example, I am working on a CI system for my work on my own time(they dont have one) and I take 5 minutes every hour to think about it and jot down notes. This motivates me as this is my reward for working on dull tasks.

And it does not have to be programming related, it can be your hobby, or a big event in your life or anything, anything that makes you work through boring tasks to get to them.