5S as a software development tool

Most people quickly think of Scrum when they think of software development. However, did you know that the 5S Lean principles are also essential for writing maintainable and reliable code?

Here, of course, it is not the case that a tidy workplace will lead to good software. No, essential to good software quality is clean code. And as James Coplien notes a tad surprisingly but oh so rightly in the book Clean Code, the 5S principles are perfectly applicable for “clean” code.

Good example follows good practice: when it is already a mess, little attention will be paid to making an addition neat. After all, extra debris on a mess doesn’t stand out. This is true of any workspace, but it is certainly true of code as well. Indeed, when developing new code, either consciously or unconsciously, surrounding code is used as inspiration for the new one.

Another very important principle of the 5S methodology is the well-known floor marking in factories or the shadow board for tidying up tools. People like to clean up stuff, but it should be clear to everyone where something should be cleaned up. After all, when tidying up, it is very important that everyone uses the same layout. And nothing could be further from the truth in software development. Clearly structured code will not only have to be easy to understand, it will also have to make it obvious where new functionality needs to be added.

5S for clean code

  • Separate: Distinguish between what is necessary or unnecessary. Discard what is not used (dead code), broken or duplicate (code duplication).
  • Arrange: An appropriate place for everything and everything in its place. Everything should be findable by everyone (clearly named). It should be where you expect it to be and it should be clear to everyone where something should be placed.
  • Clean up: Keep your code clean and restructure with every change so it stays neat (refactor).
  • Standardize: Agree with your team on your practices and make sure everyone works the same way (coding conventions).
  • Persevere: Create the group discipline to stick with it. Don’t succumb to time pressure and remain critical of yourself and each other (code reviews).

Want advice or support in clean coding. Please feel free to contact us so we can support you in getting clean code.