“Boy scout rule” meaning

We all have heard this expression for once in our lives. But what does this mean?

When people started to use this expression and why?

I am sure that everyone has that friend who writes code that no one else could understands without refactoring. Am I wrong?

“There’s no problem so simple that a bad developer can’t make it complicated.” Steve Bohlen

You don’t want prgrammers to talk about you like Steve does. Don’t you agree?

So..how can we stay away from this bad practice?

The answer is simple: you need to investigate your mistakes and after that you need to improve your coding style!

How am I supposed to do that?

Here is where Clean Code comes to your aid!

Clean code is about recognizing that your audience isn’t just computers, it’s also about humans.

If you will folow the clean code principles you will know how to write clean code.

If you want to know more about these principles, I recommend you the Robert Cecil Martin’s book, “Clean Code".

One of those principles is called the Boy scout rule. It says:

“Leave the campground cleaner than you found it.”

What do you mean by that?

It is obvious what it’s refer to. This principle is about leaving your code better than you found it.

There are always things to improve in a method, class, function, behavior. If you see a mistake, you should improve it. You will help the next person that read that part of code.

If you want to learn more about the clean code principles take your time, it will help you a lot and you also will help us, programmers as you.

In the end this is all about, helping each other to make our lifes easier.


I hope you learn something from my thoughts.

Thank you for your time,

Kind Regards,
Madalina
Like what you read? Give Madalina Nanu a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.