DEV Community

Discussion on: Tidying Up Your Code: KonMari Style

Collapse
 
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.

Collapse
 
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.

Collapse
 
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. 🕳️

Collapse
 
jamesdengel profile image
James dengel

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

Collapse
 
kaydacode profile image
Kim Arnett 

Shoutout to @ben for his scout rule shoutout :D
dev.to/ben/the-boy-scout-rule-is-n...