Software Creation Mystery - http://softwarecreation.org

Stuck on a Big Hard Programming Task? Read this!

Sometimes I am stuck on a mind-boggling task. I know this because I found myself fiddling around, giving advises to other people, searching for food, drinking coffee or working on low priority stuff. Clock is ticking but little gets done. After I notice this unfortunate state, I talk with myself seriously – calling to conscience, sense of duty and pride of a man who never fails his mission and the team.

Over the time I have learnt how to return to a productive state and even finish difficult tasks. I want to share my experience here.

Precondition
I assume that you have a good idea what you should build. If not, you have to get back to your notes, client or a drawing board. You definitely will be unproductive if you don’t have clear understanding of your task. Most probably you will waste your time and client’s money.

Now, you know what to do but don’t know how and intellectually overwhelmed by this too big to bite piece!

I recommend 3 phase strategy to conquer your difficult task:

  1. Hit the road – start moving and build the confidence
  2. Take control – conquer uncertainty and map the road
  3. Accelerate – drive on full speed while keeping control

Hit the road

“Writing a novel is like driving a car at night. You can see only as far as your headlights, but you can make the whole trip that way” – E. L. Doctorow

25 Minutes Burst
First, you have to physically sit in front of your computer – ready to write code. If you are not in this well suited for programming position, you should apply your negotiation skills to put your resisting body there. It is not easy to argue with yourself, but you can always ask for firm 25 minutes attempt in exchange for some personal favor. Use these negotiated minutes to hit the road – start powerful programming burst. What about other 25 minute burst after a short break? And another? You can try The Pomodoro Technique.

Pick Low Hanging Fruit by Fruit
The Huge Difficult task will try to kick you out of a saddle (chair) and immobilize. You have to gain confidence and steady mindset to make a real progress. Dive into programming as soon as you can. Start with some necessary piece that you know how to implement. Not everything should be clear – just couple steps ahead. You will discover next steps while you work on the current. Pick fruit by fruit to gain momentum: move from one small task to another without stops. Hold the chain of these tasks to stubbornly step forward against severe winds and waves of procrastination.

Copy and Paste
Copy and Paste is a bad practice. However, it is an excellent starting point if you have huge demoralizing task. Find similar code in your previous projects, help examples or Google / Stackoverflow it. Refine and knead these examples into acceptable for your purpose shape. Certainly, remember to clean and remove bad effects before you finish.

Offensive Reconnaissance
Survey the territory of your development task for potential paths and roadblocks. Do not engage in open fights until you mentally strong and prepared. Work on discovered tasks only if they are easy, otherwise estimate complexity and mark them for the next phases. In order to have better intelligence you can

  • Search on Internet for implementation ideas
  • Talk with somebody who can spark a solution (at work, online) or at least with Rubber Duck
  • Load information in brain and forget about this problem – let your subconscious to prepare for the Eureka! moment while you are busy with other stuff.

Important question: Are you ready for engagement?
Tell honestly if you feel you are not ready to tackle the task. Ask for help or take a break to learn. You will put yourself in a bad stressful position continuing struggle and failing at the end. It is not fair to your team, company and clients. Nobody will appreciate it.

Phase Outcome: you are on the road and can get things done!

Take control

“Chance favors the prepared mind” – Louis Pasteur

And your project manager and client stand behind and nervously ask – “When are you going to finish this f* task?”

Long drive in the dark is not fun and not safe – you can be late and end up in the wrong place. Once your mind stop resisting and become cooperative, you should grasp the control and get better view how to get your task done and what effort is required.

You would ask: “Why do not take a control at the beginning – plan all operation steps ahead and follow them with discipline?” My answer: You need offensive reconnaissance into task area and prepared mind for planning. Also you need some time to play with the task, align your mind with people, requirements, technology, tools, environment and other moving parts. That is why Hit The Road is an essential stage for programmer’s timid mind scared by The Big Monster Task.

Break down
First, break down the big task on smaller steps to map your road to victory.

Fire Tracer Bullets
Build small quick simple end-to-end working prototype that touches all major components. Connecting them together and making them work is a big achievement to find your target solution. This will become your frame for next programming pieces that you discovered during reconnaissance.
Plan deeper spikes for technically risky and unknown areas.

Evade Premature Fights: Grand Re-Design, Refactoring or Optimization
You  will be tempted to apply your outstanding architecture skills and guru expertise to radically improve design of the system, completely refactor a cluster of ugly classes or optimize potentially slow layers. Be careful – these activities often lead  to a deep pit right before finish. Exercise self-restrain and pragmatism. Focus on a practical solution that solves the client problem, not idealism of the perfect system. If you need a lot of tension – go to gym or create a separate task from the current to accomplish these amazing feats with the system.

These are sign that you took the control:
1. You know your major steps to finish the task
2. You can estimate time, effort and risks for these steps
3. You know what is unknown and how to deal with this stuff

Phase Outcome: you have a plan, estimation and a frame for putting things together

Accelerate

“A good plan executed today is better than a perfect plan executed at some indefinite point in the future.” – General George Patton Jr

Once you have clarity and mental control, you can move on a full speed. You just need to keep high motivation, control and quality. Rare developer’s mind will resist to program at this point 🙂

Small Clear Wins
Keep moving from one small victory to another leaving behind things that you like, work good and well-refactored. Do not leave half-baked pieces that collapse after you step away.

Immersion
Enter Flow – “mental state of operation in which a person in an activity is fully immersed in a feeling of energized focus, full involvement, and success in the process of the activity”.
Conditions for flow:

  1. Clear goals that add direction and structure to the task
  2. Challenges match skills – you feel capable to wrestle a task, but not easily.
  3. Immediate feedback – you can quickly adjust based on the results of work and changing demands

Anti-perfectionism
Don’t overthink the problem and spend too much time on polishing of a good enough solution. Instead strive for simple design, open for future extensions and delay big decisions for later than you have more information and feedback. Just know when to stop and have confidence that the stuff you claim as done is really DONE.

Phase Outcome: your train is moving on the full speed to the final stop on a schedule and nothing could stop you 🙂

Can you share you own strategies to overcome and conquer difficult tasks?

AddThis Social Bookmark Button AddThis Feed Button


Comments

Lol @ Good Enough Solution. Overall, this was excellent!

Comment by Andrew | April 26, 2011 9:18 am

How aboout Never Give up attitude on solving a tough task ?

Comment by Senthil Kumar B | April 26, 2011 12:57 pm

Agreed with Senthil, tenacity is very valuable in debugging. Also frequent breaks are a great suggestion, especially if you have the tendency to “hyperfocus” on a particular piece of code and lose sight of the big picture. Many times I’ve yanked myself out of a roadblocked coding mindset for a while to play a game or take a walk, then come back, and suddenly I see a new solution or realize that I’ve messed something up elsewhere which when fixed addresses the original issue.

Comment by Darth Continent | April 26, 2011 2:23 pm

[…] Stuck on a Big Hard Programming Task? Read This! (via softwarecreation.org) […]

Pingback by Stuck on a hard programming task? | Shwuzzle | April 27, 2011 8:25 am

[…] Stuck on a Big Hard Programming Task? Read this! […]

Pingback by ???????? ??????, 29 ?????? | ???? ???? | April 29, 2011 1:50 pm

Hitting the road is definitely an important step to undertake quickly, and majority of your suggestions deal with forcing one’s on mind to actually stop working against the task at hand. I agree with that, as I see some of such qualities in me.

I also like the approach of “offensive reconnaissance” and spiking. Too frequently are important technical problems glanced over and deemed inherently solvable. This may not always be the case, given the time and scope constraints. That is when adjustments can be made to reduce scope, refine requirements, or scrap a feature altogether. As long as it keeps the job moving, I believe this to be a reasonable outcome.

Comment by Jenya | May 5, 2011 2:45 pm

This blog have little value without you and your comments, thoughts and discussions. Please, leave your comments. You are welcome to debate and criticize any idea, but, please, don't attack other people. Thanks for your contribution!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Subscribe without commenting

Software Creation Mystery - http://softwarecreation.org
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License .