5S is a well known quality system developed is Japan after the Second World War to guarantee that the company using it was delivering the best quality products they could while creating a good work environment.
One of the most famous company using the 5S system is Toyota. We could say that the system focus on manufacture companies. However, it also appear, by indirect means, on code quality books like the "Clean Code" and can help tech companies achieve a better code delivery by creating a work system around 5S' principles.
The 5 principles

1. Seiri or “Remove unneeded”
Seiri is sorting all items and removing anything unnecessary by tossing it away. The ideia is to create an environment where is easy to find anything needed, avoiding distraction by unused item and/or trash. Anything unnecessary should be removed from the environment.
Based on this system, we should remove any unused code from our base. That means any code that is commented out (You ain't gonna need it), any comments that doesn't explain anything, and, of course, any code that doesn't do anything or that isn't even called on the rest of the code base. If the commented code is something you know you’ll need on the future, you can create a new branch and commit it; use some good commit messages to know where to find the commit where you removed it; or just put the commit hash on a note that you know where to find.
On the computer side, clean out your editor. Do you have more plugins than you need? Is there any browser tabs that you can close, emails that you can delete? If you are a terminal person, check you dotfiles, alias and folders too. There is always something you can remove to keep things cleaner.
You can also apply this to your working desk. Remove any unnecessary item that could be cluttering your desk. Trash it or put it on a place where it can be accessed when needed, in case it isn’t an item that you used everyday, but you know you’ll need on the future. Keep a clean desk with only the necessary items on it. But keep in mind that only you can decide what is necessary or important to you.
2. Seiton (Set in Order)
This principle aims to organize anything that was defined that is necessary but is out of place or is hard to understand its use. This creates a smoother work flow, where everyone knows what anything is based on a categorized system.
Thinking on a code environment, our folder system should use names that are easy to understand and every piece of code has to be on a folder that is related to the category that code should. The same is valid for file names, functions and classes. That means that we must avoid using names that has lose meaning, like "utils" and "helpers", because it’s like putting it on a bland deposit, who knows what could be inside of it?
This also means creating a system that helps devs to categorize their code. Be it MVC, MVVM, Hexagonal architecture, or any other system. The important here is that the system helps everyone to categorize and then find a piece of code. There is less “I think it would be nice for it to be here” and more “We are using a MVC system and this is a controller, so it should be on the controllers folder” type of thinking.
On my personal projects, I’m more of a person that prefers recursive architectures, where you can separate better what is specific of a subsystem, instead of always using globalized folders. You can imagine it like a project where when you enters a specific feature folder, you see a mini MVC inside of it, and that feature is separated in modules where each module has more mini MVCs.
On your digital space, we can use this principle to categorize the files in you computer or even on social media. Are you mixing up stuff? Is there photos on you videos folder? Did you publish something on the wrong social media? Here is where you recategorize stuff and put them where they should be, or a place where you can find them later.
Now on your physical space, you can use this principle to organize the things that you decided to keep on your room or office, but not on your desk. The ideal is to find a place to store them, but a place that you’ll always know a specific type of thing will always be there. This way you avoid re-cluttering your desk to keep things near you that you fear you won’t be able to find them again when you need them.
A good principle is to keep the items you use the most near you and on an easy place to see and the less and less you use something, the far and hidden you can put them. If you are a pen and paper person, you can keep a single notebook and pen near you, and you can put spare notebook and pens on a box or other place where you know you can find them when you finish using the current ones. My bigger organizing categories are:
Visible on my desk, for things that I use everyday and want to have them on my sight, this goes from the basic computer stuff to teaware, since I like tea. Here I also put some toys that I like to see to remind me of what I like and to try to avoid to take things too seriously
Near my desk, but not visible, I put things that I use a lot, but I don't need them to be visible, like fidget toys, medicine, paper and pens
Visible, but not near my desk, is for things that I use outside of work or that I bring to my desk to use them for a while and them put them back to their places. Here you’ll see books, old notebooks, more teaware, games and different keyboards
Almost hidden. I say almost, because they are boxes that I know what is inside of them. I just don't keep them visible or near me. On them you’ll spare notebooks, more boxes with documents, spare desk pads, spare mouses and keyboard pieces, in case I want to customize one or fix it.
3. Seiso (Shine/Polish)
Seiso is cleaning and maintaining the workplace, equipment and machinery. This helps a company avoid accidents, by keeping everything is place and working as it should. Also, anyone that keeps cleaning their tools, are more able to see when anything isn't working as it was supposed to be.
On a smaller picture, it's our job to keep our code tight, clean and organized. This principle means that you need to make sure you did you best to clean any mess you made while trying to find a solution, fix a bug or implement. Make your code the best you can make before opening a PR.
However, as we keep working, our code will get messier. We'll do some minor changes that shouldn't be made or make some poor choices to solve some bugs that we need to solve that exact moment. This are actions that we take for a reason, but that asks for a bigger and more thoughtful solution to clean them out. If we don't come back and clean all these problems, our code can get hard to read, or lose performance. The natural state of any code is to get "dirtier" as we keep working on it. So, the process of cleaning it is just a natural response that we need to do to keep it clean. We already know this and we, as devs, already gave a name to it, technical debt.
Dealing with technical debt is a problem that happens on every company. Should I open a ticket to solve it on the future? Should I just clean as I see it? Should the company reserve a time to do it on every sprint or week? Those questions are hard to give an answer, because that will depends on a lot of variables. The principle only tells you about the benefit of keeping things clean, that, translating to a software environment, would mean less bugs, security issues and weird behaviors. This needs to be a company and/or team effort to clean past mistakes. The physical equivalent of this is the need that companies have of a cleaning team to deal with bigger things, while you keep your desk clean.
Which brings me to our desks. We also need to keep them clean. Now that we decluttered them, we need to clean them. On the process of clean, notice if anything needs a fix. If you use a mechanical keyboard, check if all keys are good. Clean you keyboard and remove the caps. Check your mouse. See if you need to replace any pens, fill in any fountain pens.
Back to the computer side, take a look at your tools. Is there any where you can make them simpler. A script that can be refactored. A plugin that you can trade for a different one that does the same thing better?
4. Seiketsu (Standardize)
Standardize any process, including the process to maintain the three principles above. On here we can also add standards for tests, for what programming paradigm your company will be using. Add/create any standard that can help programmers code faster and maintain the code base.
Here is where code shines. I like to think that standardize is automatization for the physical world and for us. With it you already know what to do and stop thinking where I should put this. Instead of “where this photo should be” you start thinking “of course the photo should be on the photos folder and categorized by year/place”.
For code, we have linting tools to really automatize that for us. In this case you don't even have to know the standard. The computer will tell you or even fix that for you. You can also create scripts that will help you. Scripts that renames files and put them on the correct folder.
The important thing here is to make all the processes that you made above a rotine. You can automatize some of them and put the rest on a schedule, be it daily, weekly or monthly. It's up to you.
5. Shitsuke (Self-discipline/Sustain)
The last principle, but not less important, is related to self-discipline or to how can we sustain all the other 4 principles. Some people also translate this principle as "doing without being told".
The first part of it is having the discipline to maintain the other four principles. However, this principle also incorporate the study and training that is necessary to be able to always be better. Another important part of this is receive and giving feedback, specially from those that is on the front-line of the work, on our case, the developers and designers.
That is why this is the last principle as it closes the circle. This principle is a way to say to you that you need to go back to the first principle again and do it a little bit better. It not only asks you to simply repeat, but repeat in a mindful way, keeping attention to where you can make it better. The important thing is keep trying and appreciate that you’ll always come back able to be better.