DEV Community

Discussion on: Clean code, dirty code, human code

Collapse
 
bpappin profile image
Brill Pappin

I think this is a vital message really.

It's much too easy to get bogged down in some sort of perfection mode, when your job is really to solve a problem in a usable way. I have had peers who spent weeks refactoring and rewriting code to solve a problem or add a feature, which should have taken a few hours to complete. They got stuck in making it perfect in their minds.

You might even call it premature optimization. You still need to keep good practice in mind as you are working, since you don't want to make your life difficult later, but there is no way you can know how to make it perfectly "clean", until you are further along in the process. Spending too much time on perfection early on, is pretty much YAGNI.

I'm old school, I really think the simplicity of "make it work, make it right, make it fast" gives you the best of both worlds.

If you avoid the pedantic need to make is perfect the first time, or make your teams code all conform to your clean ideal (which is pretty much an impossible task), then you will also cause much less friction, because every good team refactors each others code, as they come across it, but rewriting all that code is not a team exercise. You might as well be doing it yourself. You lone wolf you.