Keeping Things Clean: Broken Factory Windows

Keeping Things Clean: Broken Factory Windows

At my Computer Science course at university we were taught about code cleanliness. An anecdote to describe needing to keep everything you do “clean” was to think of a traditional factory with lots of small windows. If one window is broken should you fix it?

It is just one small window and there are many many more windows, so functionally it doesn’t really matter. One window broken isn’t going to destroy the factory.

However it sets a precedence for the rest of the factory: if that window is broken, then if another one gets broken do you bother fixing that? Well no, because it’s just one little window and you didn’t before. You continue this until suddenly there are smashed windows everywhere and the factory workers don’t really care about the quality of their work because they work in an environment where things aren’t looked after.

The analogy to coding here is clear, but it can be added to so many aspects of life and other professions.

Should you refactor something as soon as you can? Well it might only be one tiny aspect of one file of a massive project so it’s not going to make any difference on the project. However if you don’t clean it, then someone else has a horrible time using it, they will spend ages trying to work it out, maybe cleaning it incorrectly, or perhaps just thinking that since this part is a mess it doesn’t matter if their stuff is a mess too. This is particularly true on larger projects. You should always assume your project is going to become massive; similarly it might not be touched by yourself for years if you really do think you will be the only one using it.

The same can be applied to focus. Maintaining focus on a single particular task is crucial to not only ensure you complete a task to the best of your ability without distractions, but it ensures you are a lot more productive with your time as a whole. Too many people I know spend their life with Facebook open in the background, and email alerts coming up on their phone or desktop whilst they are at work. Not only does it distract your train of thought but it makes one task take a lot longer to complete.

If you can’t focus on a task until it is complete then you haven’t broken the task down into chucks that are actually manageable.

I try and keep these points in mind in all aspects of my life:

  • Actual cleanliness of my flat: clothes, bed, dishes, desk, shelves
  • Work: planning out projects, structuring my day, logistics, coding, sending status updates to clients/mentors
  • Fitness: monitoring progress, organising cycle rides in advance together with logistics, partaking in fitness classes
  • Food: writing down shopping lists, marinating food, preparing ingredients, organising cupboards and work surfaces

Spending the extra time on this overhead of making sure everything is clean and set up correctly will save you valuable time in the long run allowing you to get much more done!

I struggle to understand how people can get anything done when they live in such an unorganised environment:

A ridiculously dirty room
A friend’s dirty room

Another good story was a parent asks his kid why he hasn’t made his bed. The kid says: “I’m just going to mess it up and sleep in it tonight”.

The parent responds with “But you are just going to poo again tomorrow after you go to the toilet today…”.

Comments are closed.