DEV Community


Discussion on: Tidying Up Your Code: KonMari Style

marek profile image
Marek Zaluski

I find it works well to make small cleanups to a file or a function whenever you're already in the file to work on a feature or bug.

Leave the code a little bit better than you found it.

Tiny, incremental improvements add up.

And like you pointed out, code ghost can remain in a project long after it's no longer being used for anything. It's a great feeling when you can safely delete a bunch of old code and make the codebase smaller.

qm3ster profile image
Mihail Malo

One of the biggest pitfalls of this approach is you end up with refactoring commits mixed with feature commits.
It takes discipline, organization, and understanding to put all of your refactoring first, then all of your feature, then more refactoring if you feel so inclined.

marissab profile image
Marissa B • Edited

Leave the code a little bit better than you found it.

Excellent way of going about it, just be mindful of changing too much and falling into the deep "Well I should just clean up this thing real quick... And that thing... Then these things..." pit. 🕳️

jamesdengel profile image
James dengel

Yes, I prefer development to be iterated, recursive development leads to issues :)

kaydacode profile image
Kim Arnett  Author

Shoutout to @ben for his scout rule shoutout :D