by twodave · 5y ago · 0 comments
1. Business value isn’t always a measure of coding velocity. Interruptions are often gifts in disguise.
2. The ability to work in a way that allows for interruption is a skill that can be learned.
As a younger programmer who loved nothing more than to sling vast amounts of code, interruptions were killers. Over the years I’ve learned to recognize interruptions as opportunities to re-assess my priorities. I’ve also learned to write code in a way that reduces cognitive load so that interruptions aren’t so disruptive to my productivity.
I’m not going to try and say these are universal principles or that any business can apply them, but as highly skilled workers I think this is an area where we tend to put in relatively little effort to overcome obstacles.
> 1. Business value isn’t always a measure of coding velocity. Interruptions are often gifts in disguise.
Yes, there's a known partitioning between design and implementation, and it's very difficult to do both at once. Those "business value" decisions usually occur in the design phase, when you're not being precluded by implementation. However, interruptions are not the right way of doing the design phase.
Interruptions, by definition, occur when you were in the middle of some work, and if you were doing implementation work, result in you losing context (and therefore productivity) for something that is rarely design-related - and even relying on this for design/"business value" guidance is a hack, because you should be purposefully allocating some dedicated time to take a break from implementing and instead design and strategize.
Replying on unplanned interruptions to do this for you is suboptimal from every perspective and will be difficult and frustrating.
> 2. The ability to work in a way that allows for interruption is a skill that can be learned.
Absolutely - and yet, someone who has this skill and is interrupted is still less productive than someone who has the skill and isn't productive. Unless every one of your interruptions is essential (which isn't true for the vast majority of developers, including me), then learning the skill alone is just a hack, because the root problem is that you're being unnecessarily interrupted in the first place.
I'm my own worst enemy when it comes to interruptions, which is why I kept 2 of my 4 tips aimed directly at myself for how I improve my focus.
At a team level, I made a clarifying point that small interruptions are okay, but often not worth it. While I can bounce back, there's a high risk I won't. I'm my own worst enemy (not passing the blame to anyone, I personally need to work on my habits to be better at bouncing back to what I was doing). So it's important our teams work together to make sure the interruptions are worth it. One way my team helps each other is we setup a @mention rotation in Slack (see tip 1). It allows us to schedule shifts daily, so only one person has to plan on their day being interrupted with brush fires. It's a win-win, because we share the load, but we also make it so frontline support knows who to contact (we use @devs).
I feel it's unfortunate the title made it come off as just another article whining about interruptions, that wasn't my intention, I'll do better on my next title.
That said, over the years I’ve learned to recognize that when I’m buried deeply enough in anything for an interruption to be particularly disruptive, I’m setting myself and whoever has to deal with my work next up for failure.
Even more so, working from home with 4 kids who homeschool, it just wouldn’t work if I couldn’t find a way to deal with urgent and jarring interruptions haha.
> 1. Business value isn’t always a measure of coding velocity. Interruptions are often gifts in disguise.
The value isn't in the interruptions itself, but rather in the injection of context and perspective to the work being done.
Those can be delivered through interruptions like email and chat, but it is by no means necessary. Relying on interruptions is just a lazy default that results in much less real value delivery than could be achieved with a more thoughtful approach to organization design and workflows.
> 2. The ability to work in a way that allows for interruption is a skill that can be learned.
Working deeply on a problem without interruption (no checking email, HN, etc.) is the real skill, and one that is getting increasingly difficult to practice.
> Over the years I’ve learned to recognize interruptions as opportunities to re-assess my priorities.
That's a good habit, but it would probably be better to just minimize interruptions and set aside time for such reflection.
> I’ve also learned to write code in a way that reduces cognitive load so that interruptions aren’t so disruptive to my productivity.
This seems promising, but I would be willing to be that the benefits of reducing cognitive load would be even greater in an environment of minimal interruptions.
However, I do agree that it is good to be prepared to handle interruptions well.
I'll be very interested to hear what you have to say on the subject of minimizing cognitive load.
Have you figured out how to explain this to others? Some people don’t seem to get why their amazing code is more of a dumpster fire.
It genuinely seems to me that the Feynman Hypothesis holds true: If you can't explain it simply, then we don't really understand it.
And for certain if you can't explain the code simply, there's no way to make the code simple.
The term "deep work" is from here https://www.calnewport.com/blog/2012/11/21/knowledge-workers...
I have too, but sometimes I have to read other people's code, and I don't have any control over how difficult that is.
It may take some creativity, and I won’t claim this is universally true, but in all but the most exceptional of circumstances understanding of even an ugly codebase can be accomplished in bite-sized pieces.
With conventional coding, if your house of mental cards falls, you may potentially lose all of your work. By working from working code to working code, even if you lose your train of thought you get to keep most of your work so far.
A number of other techniques also allow you to work more from working memory than memorization. This helps when writing code a little bit, but most of the payoff is for readers or subsequent additions.
The thing with DRY is that code reuse means that a breakpoint most likely can fire from multiple paths, which makes it hard to trace why you’re getting null/undefined instead of an empty array as your second argument. Conditional breakpoints can help for some of these scenarios, but it’s better if the code in the middle of the call stack tries to be as contained and organized as leaf node methods eventually become.
You can’t modify code if you can’t read it, and if it’s difficult to read then interruptions become more problematic, because both the cost of interruption and the likelihood of interruption go up when thinking time increases.
The cleverest code is the code which is easiest to understand.
Things I used to do 10 years ago:
- launch headlong into a task as soon as I understand the problem statement
- pick up a ticket/bug, quickly attempt to do as little as possible to make it go away
- unit tests/integration tests pretty much never
- lots of (many times unnecessarily) complex SQL
These habits led me away from a place of understanding an overall system and towards a place of adding lots of entropy to the codebase. In an ideal world, every time you touch a codebase you should be trying to remove entropy. If ever you introduce new rules or ideas into a codebase, it should be like pulling teeth because every time this happens the cognitive model you have to hold onto just to work on the project increases, which slows down the entire team. Being contemplative about the repercussions of a change (especially its impact on cognitive load) can help steer a team as a whole toward better decisions. Being quick to point these factors out in kick-offs and PRs helps protect the codebase as well. It's a lot of work, but when a project operates under this kind of structure there just aren't that many things that require a large amount of focus. And those that do don't necessarily require active focus.
Having a variety of things to do helps. If I start to death spiral on a problem (which is how I describe the feeling that I'm overloading my mental map), I'll put the problem down for a bit and work on something else.
Having a strong grasp of the subject matter is also a huge help. E.g. I work on a payroll platform. Learning how payroll should ideally work while at the same time writing code for the platform wouldn't be an ideal scenario (we definitely had to do this at times, but most of us had at least a few years background around payroll-related business functions). I've found this to be the biggest blocker to my productivity whenever I start a job in a new field.
Over the last 10 years I've worked in:
- Payroll/HR
- Luxury/Athletic Clubs
- Autism care providers
- Workers' Compensation Insurance
- Financial Performance Reporting
I've done the above using probably half a dozen different programming languages, team sizes everywhere from 2 to 50+, and (I believe) because of the way I approach my work that there's really never been a time in that period where I couldn't hit pause and pick it up later.