The Story About the Boy Scout Rule

The Boy Scout rule (always leave the code in a better state than when you found it) is famous among developers, but does it have its pitfalls? Meet Simon and Andy, who have a lot to share.

The layout of Mr Meyer's office is more suitable for questioning than for productive conversation: a massive high-backed chair that looks more like a throne, a long desk intended to separate the host from guests, and odd portraits of old long-bearded men looking shrewdly at anyone who has to report to the boss.
Today, that honourable duty goes to Simon and Andy. Not that any of them are happy about this great opportunity, in part because of the office's oppressive atmosphere, but mainly because of the reason they are there.

Mr Mayer represents "Chips Industrial", the company that outsources development to the firm where Simon and Andy work. After the recent release, their flagship product's revenue fell by 15% due to a software bug, the nature of which they were trying to explain for ten minutes.

"Once again, what was that release for?" Mr Meyer asks.

Simon, the project manager, is the one to answer: "We added a new feature to the application, so users could find products by a bar-code".

"And why did the money go down?"

"Unfortunately, this change had an accidental and undesirable effect — all payments from PayPal stopped coming, and we have a fairly large set of PayPal users, hence the drop in revenue".

"Undesirable effect," Mr Meyer repeats slowly and then pauses.

Andy, the developer, breaks silence: "We've already reverted this feature, and all metrics are back to normal. Now, we're working on a fix and then we'll re-land the change".

"Oh, thank you!" Mr Meyer exclaims. "Why am I asking this when I must praise you two! We paid for two months of work so you could release the feature, drop money and heroically revert it. Why the hell did you have to break PayPal, bar-codes must have nothing to do with PayPal?!"

"They don't," Andy agrees. "But we had to change the database, and we noticed some inefficiencies in the schema: unused tables, meaningless foreign keys, even typos in column names. As we worked on a migration script, we just followed the Boy Scout rule and did a cleanup".

"But why?", Mr Meyer looks puzzled and annoyed at the same time.

"One renamed field was still used by the payment system, and we missed it".

"That's not what I ask," Mr Meyer interrupts. "Why to touch something unrelated to the feature? To me it looks like somebody in your company sabotaged the project".

"No-no-no!" Simon hastily waves his hands in response to this accusation. "Nobody tried to sabotage anything. Moreover, all our people worked to do their best to improve the codebase. Yes, accidents do happen sometimes, and we were prepared to quickly revert the feature and recover the database. As for your initial question, it is an industry's common practice to continuously improve parts that need improvement".

"The Boy Scout rule — always leave the campground cleaner than you found it," Andy adds.

"Okay," Mr Mayer says and starts furiously typing something on his keyboard. Clack-clack-clack click clack-clack. Andy and Simon are at a loss to guess what he is up to, but they do not dare ask. After two minutes of laud clacking and clicking, he turns his laptop over to Simon: "Read it to me".

The project manager comes to the screen, close enough to read from an excel spreadsheet. "Product designers — one," he begins and then looks blankly at the owner of the office.

"The list of people who work on this project. For whose work I pay," Mr Meyer explains slowly and distinctly. "Continue".

"Project manager – one. Senior developers — two. Junior developers — one. QA engineers — two," Simon finished reading. "I'm not sure I understand..."

"Where are Boy Scouts? Where? Do I pay for Boy Scouts?!" Mr Meyer breaks into a scream. "Are you a Boy Scout?"

Simon shakes his head.

"You?" Mr Meyer looks at Andy, but he cannot find what to answer. He opens the mouth to explain the nature of the boy scout rule and why it is reasonable for developers to use it, but Simon intervenes before he can start:

"We are sorry, Mr Meyer, that was totally unacceptable. We are working hard to re-release the feature without the problematic cleanup, and we will make sure similar problems won't happen again."

"You meant to add a new feature, not to break payments!"

"That is fair".

"Why not to do your freaking clean up after the feature? We advertised it to users — can you imagine how busy our support is right now?!"

"I understand, Mr Meyer, that was an oversight on our side, and we will do our best," Simon continues, seeing that despite heated atmosphere, Mr Meyer looks a bit calmer. "It won't take too long — end of the week the latest".

After a long stare at Simon, Mr Meyer sinks into a chair. He nods silently as if coming to a conclusion in his inner dialogue. Then he purses his lips and points to the door, much to Andy and Simon's relief.

"And keep an eye on your damn Boy Scouts!"