To Yak Shave or Not: The Art of Procrastination in Software Development
As software engineers, we’ve all been there: You sit down to tackle a seemingly straightforward task, only to find yourself hours later, deep in the weeds of something entirely unrelated. This phenomenon, known as “yak shaving,” is a common pitfall in software development, particularly in the world of frontend development with technologies like TypeScript and React. Closely related to yak shaving is another concept called “bike shedding,” which, while similar, has some distinct differences.
In this blog post, we’ll explore these two concepts in depth, drawing from real-world examples and years of experience in the trenches of software engineering. We’ll discuss what these terms mean, how they manifest in day-to-day development work, and strategies for avoiding them and staying focused on the task at hand.
Understanding Yak Shaving
The term “yak shaving” has its roots in an old story about a man who sets out to accomplish a simple task, but finds himself performing a series of increasingly peripheral tasks, ultimately leading him to shave a yak. In the context of software development, yak shaving refers to the act of engaging in tasks that, while seemingly necessary, are not directly related to the primary objective at hand.
A Real-World Example
To illustrate yak shaving, let’s consider a real-world scenario that I encountered recently while working on a TypeScript and React codebase. My primary task was to implement a new feature: a real-time chat component for our web application.
-
Initial Task: Implement a real-time chat UI using React and TypeScript.
-
Yak Shaving 1: While starting to implement the chat component, I realized that our project’s TypeScript version was outdated and lacked some of the newer type utilities that would make the implementation cleaner and more robust. So, I decided to update TypeScript.
-
Yak Shaving 2: After updating TypeScript, I discovered that the new version broke compatibility with some of our existing code. I had to go through and update various type definitions and refactor code to work with the new TypeScript version.
-
Yak Shaving 3: While refactoring, I noticed that some of our unit tests were failing. Upon investigation, I found that the testing library we were using was also outdated and wasn’t fully compatible with the new TypeScript version. I decided to update the testing library.
-
Yak Shaving 4: In the process of updating the testing library, I realized that our code formatting and linting setup was misconfigured and not enforcing the style guidelines consistently. I took a detour to properly configure ESLint and Prettier.
Before I knew it, hours had passed, and I hadn’t written a single line of code related to the actual chat feature. I had fallen into the trap of yak shaving.
Strategies for Avoiding Yak Shaving
While yak shaving is sometimes unavoidable, there are strategies we can employ to minimize its impact:
-
Clearly Define the Scope: Before starting a task, clearly define what is and isn’t part of the immediate scope. If something falls outside of that scope, make a note of it, but don’t let it derail your primary objective.
-
Timeboxing: Set a time limit for your primary task. If you find yourself going down a yak shaving path, the time limit will help pull you back and reassess whether the detour is truly necessary.
-
Iterative Development: Instead of trying to solve every possible related issue before completing the primary task, aim for an iterative approach. Get the core functionality working first, then iteratively improve and refactor.
Bike Shedding: A Different Beast
Closely related to yak shaving is the concept of “bike shedding,” also known as the “Law of Triviality.” Bike shedding refers to the tendency for people to give disproportionate weight to trivial issues while neglecting more important and complex ones.
The term originates from a story where a committee spends the majority of its time discussing the design of a bike shed (a relatively trivial matter) while glossing over the design of a nuclear power plant (a far more complex and important issue).
How Bike Shedding Differs from Yak Shaving
While bike shedding and yak shaving are often conflated, they have some key differences:
-
Scope: Yak shaving usually occurs on an individual level, as a developer goes down a rabbit hole of related tasks. Bike shedding, on the other hand, is more often a group phenomenon, occurring in meetings, code reviews, or discussions.
-
Nature of the Tasks: In yak shaving, the tasks, while not directly related to the primary objective, are usually still necessary or beneficial in some way. In bike shedding, the focus is on truly trivial matters that have little bearing on the overall project.
-
Root Cause: Yak shaving often stems from a genuine need to address related issues or dependencies. Bike shedding, however, is often a result of people’s tendency to focus on issues they understand or have an opinion on, even if those issues are relatively unimportant.
An Example of Bike Shedding
In my experience, bike shedding often rears its head during code reviews or planning meetings. For instance, consider a code review for a new feature implementation. The core functionality of the feature is sound, but the review gets derailed by extended discussions about trivial matters like variable naming conventions, minor formatting issues, or the color of a button.
While these discussions might feel productive, they often distract from the more important issues and delay the overall progress of the project.
Avoiding Bike Shedding
To minimize bike shedding, consider these strategies:
-
Establish Clear Priorities: Clearly communicate and agree upon the priorities of the project or task at hand. When discussions start to veer off into trivialities, gently remind the group of the main objectives.
-
Time Management: In meetings, allocate time proportionally to the importance of the topics. Don’t allow trivial matters to consume a disproportionate amount of time.
-
Defer Trivial Matters: If a trivial issue does need to be addressed, consider deferring it to a separate discussion or assigning it to an individual to handle outside of the main meeting or review.
The Importance of Focus and Prioritization
At the heart of both yak shaving and bike shedding is a loss of focus and a misalignment of priorities. As software engineers, our ultimate goal is to deliver working, high-quality software that meets the needs of our users. To do this effectively, we must be mindful of how we allocate our time and attention.
By understanding and recognizing yak shaving and bike shedding, we can catch ourselves when we start to stray from our primary objectives. By employing strategies to stay focused and prioritize effectively, we can minimize these pitfalls and be more productive in our work.
Conclusion
Yak shaving and bike shedding are common pitfalls in software development that can lead us astray from our primary goals. By understanding what they are, how they manifest, and strategies for avoiding them, we can be more mindful and effective in our work.
Remember, the path to successful software development is paved with focus, prioritization, and a commitment to delivering value to our users. By keeping these principles at the forefront, we can navigate the complexities of software engineering with greater clarity and effectiveness.
So, the next time you find yourself deep in a yak shaving expedition or a bike shedding discussion, take a step back, refocus, and ask yourself: Is this the best use of my time and energy? The answer might just surprise you.
Stay in touch
Don't miss out on new posts or project updates. Hit me up on X (Twitter) for updates, queries, or some good ol' tech talk.
Follow @zkMake