Monday, January 23, 2017

A Hacker's Guide To The Dip

While searching around for an old post, I discovered this draft I originally composed on 6/26/2007. Nearly everything written below I still agree with. I can't imagine why I didn't publish this back in 2007.

Seth Godin's latest book, The Dip is a must read. In it, he describes the typical flow of a project: things start off fun and exciting, and overtime, become difficult. The fun goes away and all that's left is the work. This stage of the project is called The Dip. Seth's book explores this concept and makes valuable recommendations for dealing with it.

It occurred to me that most large programming projects fit this model to a tee. If you take on a complicated enough project, whether it's for business or pleasure, you're going to hit a stage where it's simply not much fun anymore. Here are some of my preferred ways to deal with this fact of life. I'd love to add yours to the list, so mention them in the comments. Thanks!

A Hacker's Guide To the Dip

  • Expect It. This is a key point in Seth's book: projects are going to have a dip associated with them, so decide up front if you are ready to go through it or not. If not, quit while your ahead.
  • Embrace It. This was a fairly surprising idea that Seth presented: The Dip is actually a very good thing. Long story short, it will keep out all your competitors. If you are struggling like heck to get a cross platform UI to work, then, the good news is, so are your competitors. Pick a tricky problem and nail it. If you've got a big dip, then you've got plenty of protection against other hackers.
  • Have Fun. I admit it, I like to program in Scheme because it's fun. That's not the only reason I do it, but when facing the fact that I've got plenty of hours of programming ahead of me, it's nice to start off with something that's just plain fun. Chuck Moore, the inventor of Forth has even advocated a fun-down approach to programming (see chapter 3 of Thinking Forth).
  • Little Victories. Rather than facing the huge goal of a finished and shipped project, setup small victories that you can accomplish. These may be things as simple as saying: I'm getting Tomcat setup today. Fight The Dip by making itty bitty dips that you regularly beat.
  • Write Only Mode. What to do when you're working on some tricky aspect of a project and more requirements start flooding in? This only makes The Dip larger. For this, I typically create a Wiki and start documenting each request. I don't think, evaluate or prioritize them - I just record them and continue on with what I'm working on. When I've gotten to my next victory and am ready to face more of The Dip, I can go back to the list.
  • Demand Flow. Flow is that intoxicating state where time seemingly stops and work just gets done. It's glorious. The Dip disappears during flow. Make sure you setup an environment which is conducive to flow - this means no interruptions and a long stretch of time program. Not every programming session can be like this, but you should plan for a significant number of these.
  • Tune Your Dev Environment. No serious project can get accomplished until the environment is there - this means a trivial code-compile-test loop, source control, deployment is automated, and lots of other details. If there's any roadblocks to basic development, The Dip will get you big time.
  • Share Your War Stories. When the going gets tough, and it will, it's handy to have a community you can share your frustrations with. By sharing your progress and getting ideas, you'll be reminded why the heck you started this crazy project in the first place. It will help you get and stay motivated.
  • Sharpen Your Tools. When The Dip starts really getting steep consider taking a step back and optimizing your tools. Sure, you've got the basic environment there, but are there things you're doing with 4 key strokes you could do with one? Are you adding the same header to every file, so why not get your editor to do that work? An improvement in your tool set will help increase your momentum and take away yet another roadblock to your success.
  • Program Yourself Out Of It. When things get arduous ask yourself why that is? Perhaps you're writing class after class which looks more or less the same. Time to break out the code generation tools. By taking a step back and looking at the problems behind your problems, you can have a big impact on making the development fun again.
  • Visualize A Solution. When I have a bit of free time, I'll often work visualize in my head how I'm going to program a solution to some problem. I'll run through in my head which classes I'm going to create and how they'll connect. If I'm lucky, I'll actually discover a problem and re-work the design before I even write a line of code. By having the solution in your head before you even sit down, the programming session goes much smoother and The Dip is held at bay.
  • Don't Force It. I can recall my first big project I worked on. I needed to free up some memory, so I traced through hundreds of lines of code adding in various calls to free(). It felt wrong at the time, but I just pushed through it. The next I realized I could have changed a single point in the source code instead of the hundreds that I did by moving up the stack one level. I learned my lesson - if it doesn't feel right, don't do it. The solution will come to you, don't rush it.
  • Eat. Sleep. I find that my outlook on life is dramatically effected by the amount of sleep I've had and my blood sugar. Every night of bad sleep I have in a row makes my outlook on life just a bit dimmer. And then, when I finally do get a good night sleep, poof, everything is great again. Know your body, and know when you should and shouldn't be doing battle against The Dip.
  • Run. For me, there's nothing that clears my head like a jog. I find that I can work out problems while huffing and puffing that stumped me in front of a computer. This works for me, find out what activities work for you, and give your brain a chance to process.
  • Stick With It. There's no secret to this - just keep programming like mad. And before you know it, you'll be through The Dip and onto the good stuff.

No comments:

Post a Comment