DEV Community

Discussion on: How would You Handle Dirty Code?

Collapse
 
marcus profile image
Marcus M • Edited
  • Rewrite/Skip

It depends on the amount of time I'm given. If I have enough time left from another task or am being told to refactor, I'll refactor it.

If it's just badly formatted, a quick Ctrl+Alt+L (PHPStorm Shortcut for reformatting code) only takes a minute.

  • Telling my boss

Only if it's really bad and/or potentially dangerous. I'm always asking other devs about dirty code, but in a nice non-confrontational way.

PS: I really like refactoring code, it's like house cleaning, makes you feel better afterwards.