Skip to main content

Leaving code messy is unprofessional πŸ§‘β€πŸ«

Would you consider these behaviors professional?

  • The carpenter who leaves tools and sawdust on the floor after installing a window.
  • The electrician who leaves live wires exposed after installing a new lamp.
  • The cook who leaves dirty utensils and raw food on counters after finishing a dish.
  • The doctor who skips documentation once the patient has been cared for.

If you’re anything like me, you probably do not. AΒ professional is expected to finish the work neatly and clean up after themselves. Leaving a mess behind is not only rude, it makes future work harder, adds more work for someone else, and can even be dangerous.

A drill, cloth, sawdust, and some left-over boards.
A professional does not leave a mess behind.

So how about this one?

  • The programmer who leaves the code messy once the new feature works.

Many features that are added leave the system in a worse state. They are implemented without regard for the architectural consistency, add technical debt, introduces duplication, lack tests, or diverges from the style of surrounding code.

For some reason this is often considered acceptable behavior. In fact, many managers encourage this behavior. Getting features out the door trumps everything. Never mind that it will slow down future development. Short-term pressure makes teams accept it.

Some argue it’s acceptable when deadlines are tight and the pressure to deliver is high. But when will there ever be time to pause and clean up? Will you be less busy tomorrow?

We must hold ourselves to higher standards. We should expect professional behavior from ourselves. We shouldn’t mark an issue as “done” until the codebase has been restored to a maintainable state. Feel free to reduce the scope if the deadline approaches, but make sure to complete the work you commit to.

A professional job is one that leaves the system ready for the next task.

Cleaning up isn’t optional, it is part of the work.