DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Personal Branding for Software Engineers: Why It Matters and How to Start Today
  • Will GenAI Force Coders to Switch Careers?
  • How To Boost Your Software Engineer Career: Code and Life
  • AI Career Trends: What's Hot in the World of Artificial Intelligence?

Trending

  • Cookies Revisited: A Networking Solution for Third-Party Cookies
  • The Cypress Edge: Next-Level Testing Strategies for React Developers
  • Measuring the Impact of AI on Software Engineering Productivity
  • How Large Tech Companies Architect Resilient Systems for Millions of Users
  1. DZone
  2. Culture and Methodologies
  3. Career Development
  4. How To Be an Effective Boy/Girl-Scout Engineer

How To Be an Effective Boy/Girl-Scout Engineer

The "boy scout rule" is "always leave the code better than you found it." It's simple, yet not everyone is doing it. Let's figure out why and how to fix it.

By 
Alex Omeyer user avatar
Alex Omeyer
·
Jul. 28, 21 · Review
Likes (2)
Comment
Save
Tweet
Share
3.8K Views

Join the DZone community and get the full member experience.

Join For Free

Most engineers have heard of the boy scout rule: Always leave the code better than you found it. It's often been heralded as a magic cure for technical debt; if only all software engineers behaved like good citizens, our software wouldn't deteriorate so relentlessly.

But if it's that simple, why isn't everyone doing it to curb tech debt once and for all?

You guessed it. It's not that simple. So, let's figure out why — and what we can do about it.

The Boy Scout Rule — Where Does It Come From Anyway?

In 1941, the founder of the Scouts, Robert Stephenson Smyth Baden-Powell, said, "Try and leave this world a little better than you found it." Over time, this may have morphed into, "Always leave the campground cleaner than you found it," but the sentiment is more-or-less the same. The point is those small but consistent efforts to keep the campground clean avoid a massive clean-up operation down the line.

Robert C. Martin (Uncle Bob) applied this rule to software engineering: "Always leave the code better than you found it." In other words, engineers should continuously clean up small pieces of tech debt so they never have to undertake a giant refactoring project when they're too close to technical bankruptcy. Simple enough.

Why does it never work like this in practice, then?

What Gets in the Way of the Boy Scout Rule

Business pressures typically force engineers to bolt new code onto existing code, with limited time available for ensuring that the result is sane and maintainable.

This focus on short-term outcomes creates future productivity bottlenecks or technical debt: code written yesterday that slows you down today.

A vicious cycle emerges:

  • We want to ship quickly, so we bolt on some new code.
  • This makes future work more difficult, but we still want to ship quickly, so we don't take the time to clean up the code and instead bolt on yet more new code.
  • It becomes even harder to contribute productively to that part of the codebase, but the clean-up job is too big now, so we don't take care of it and continue to make more short-term contributions.
  • The code's health keeps deteriorating until we have no option but to do a massive clean-up job to be able to keep shipping.

All of this is due to the false assumption that investing in software quality isn't worth the cost and will slow down the pace at which we ship. However, as Martin Fowler explains, this assumption is flawed because clean code actually allows us to ship faster.

If you apply the boy scout rule and leave the campground cleaner than you found it, you can break the cycle. But applying it in practice is not easy.

To see the problem more clearly, let's step into the shoes of a boy/girl-scout engineer for a moment.

The Boy/Girl Scout Engineer’s Dilemma

I've been assigned a ticket. I've got to ship within a certain timeframe because I've committed to an estimate during planning. I'd like to achieve the goal and deliver business value on time, but I'd also like to leave my campground cleaner than I found it — this will make it easier for my colleagues and I to work on the code later, and the business will benefit because we'll be able to ship future work faster and it'll be of higher quality.

But how do I know how much cleaning capacity I have? How do I identify the things most worthy of my cleaning time? I can't clean up the company's entire codebase.

These are difficult questions to answer. My cleaning capacity will vary based on how quickly I can complete the new work, and identifying the few things most worthy of my cleaning time is difficult when there are so many options.

What actions might I take, given the above?

  • I might over-clean and end up delaying the shipment.
  • I might clean up a few things, but not the most important ones.

This is my dilemma.

The Boy/Girl Scout Engineer’s Release

To ship on time and spend my clean-up capacity on the most important things, I need to:

  • Be aware of all the things I could clean up.
  • Identify those things most worthy of my attention.
  • Keep track of that list and attend to the top items according to my capacity.

In effect, whenever they open their code editor, boy/girl-scout engineers need to clearly define their campground; they need to survey the landscape for potential things to clean up, rank them by order of importance, and keep track of their clean-up progress as they work towards shipping time.

Here’s Why Being a Boy/Girl Scout Is Hard — And What You Can Do About It.

Scout engineers at high-growth software companies have it rough. The business grows and moves so fast that it can feel as if tech debt accumulates overnight. Well, that’s because it does.

Using the right tools and approach, engineers who care about code quality can identify the tech debt worth cleaning up — that's the tech debt that, once cleaned up, will move the needle on real business metrics like the number of bugs, regressions, shipping cadence, user engagement, and more.

To be an effective boy/girl-scout engineer, you also need to learn about the laws of tech debt, the forms it can take, and how to fight it.

What Are the Benefits?

Proponents of the boy scout rule, like Robert C. Martin (Uncle Bob), are right — if followed consistently and applied properly, it will be your most effective tool in managing tech debt. We call it continuous tech debt management.

However, there is more to this rule than meets the eye, and the tough bit is clear consistency. Boy/girl-scout engineers need to learn about the laws and incentives that make it hard for them to be effective, but they also need to acquire the right tools and skills to really have a lasting impact on their codebases' health.

Code quality will speed up the whole engineering team and, therefore, the entire company.

In the words of Robert C. Martin, as captured in Kevlin Henney's book, 97 Things Every Programmer Should Know:

I think if we all followed that simple rule, we would see the end of the relentless deterioration of our software systems. Instead, our systems would gradually get better and better as they evolved. We would also see teams caring for the system as a whole, rather than just individuals caring for their own small part.

Being a boy/girl scout might be tougher than you ever thought, but you can do it, and it will actually save you time — so don't despair and be prepared!

Engineer Software career Software development

Published at DZone with permission of Alex Omeyer. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Personal Branding for Software Engineers: Why It Matters and How to Start Today
  • Will GenAI Force Coders to Switch Careers?
  • How To Boost Your Software Engineer Career: Code and Life
  • AI Career Trends: What's Hot in the World of Artificial Intelligence?

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!