Programmer Productivity Through Mastery & Flow

28 Jun 2018

So this morning I want to talk about programmer productivity. To discuss it, I will lean on two ideas: mastery and flow. Both come from psychology and I’m qualified to talk about neither. But since I’m a white guy in his 40’s I won’t let that stop me.

Flow is an idea introduced by Mihaly Csikszentmihalyi in his book, Flow. You should read it.

Most programmers are familiar with flow as I think of it. It’s that heady space where the context is all loaded in your head and your purpose is clear and the code is unfolding in front of you. You’re finally getting something done! Cue the doorbell, right?

Flow is a great place to be, and one of the best parts of programming. Flow is also notoriously fickle and hard to kickstart.

To get into a good flow, some things are necessary. The obvious thing is a chunk of available time. Equally important is a good task: it’s well-understood, adequately challenging but within reach, and engaging. Also, the programmer must be available to be engaged.

This last thing is tricky. Flow can be rewarding, but it also costs emotional energy, particularly when you’re trying to get started. Flow is like the awesome party that you really want to go to, but it’s across town and you’re already watching TV in your underwear.

This is where mastery comes in. I have run across this idea in a few places, but Jane McGonigal’s Reality is Broken expressed how I think about it. This is also an excellent book. You should read it.

Mastery is the feeling you get from accomplishing something. The something needs to be substantive but not necessarily titanic. The harder the problem, the greater sense of mastery.

Mastery is powerful. It’s emotionally restorative. It gives a sense of meaning, which deepens engagement. It boosts morale. It has a really tremendous impact on your work satisfaction.

It’s also why, when a project seems doomed or is dragging on longer than expected, moods droop and productivity flags. Even just a little bit of death march is still a death march.

Mastery’s impact makes it a great tool for managing productivity. Here’s the key: just because bigger is better, a task doesn’t need to be Herculean to deliver mastery. You can feed yourself little cookies of mastery with simple, nontrivial tasks.

Unit tests are a great example: when a project starts to feel intimidating or exhausting, work on tests for a while and let the clean run give you some satisfaction.

Checklists or todos are useful here, too. Checking off a task completed is surprisingly energizing. And once that vigor is back up, the flow state will be accessible!

When we are drained, it can be hard to bootstrap. A canny programmer structures their workflow to supply a steady drip of mastery: small goals, checklists, unit tests, tightly scoped projects, doing code reviews, etc.

Using mastery and flow, coders can exert control over their personal productivity. Managers and team leads can also have a huge impact: structure tasks and activities to supply mastery. Feed bigger, challenging tasks to promote flow. A team thrives on shared success!