I’ve had an application that’s been going on for about 3 years now. Kahinah was built to manage package updates for OpenMandriva Lx. I wrote it, did incremental updates to it, declared it a horrible mess and that I would rewrite it. Then never touched it for nearly two years.

The problem with rewrites is that you’re going into the mentality that you’re going to throw away all your code and restart from scratch; consequently, you can redo the whole structure of your app, make it all nice, neat, and everything looks nice. And then you start to structure your app in the “ideal” way such that you’ll never have to rewrite it again and it’ll be all perfect and modular and etc.

And then you lose motivation and stop working on it for a couple of years. That was essentially the state of Kahinah.

So that branch was pushed off to the side, and I took the old code, and now I’m doing a “cleanup”. The end goal is the same - still trying to revamp Kahinah so it’s no longer a mess, but this time it’s going much smoother, and I’m not losing motivation. Why?

I think it’s the way our mind approaches these problems. When you first start a project, you already have a good idea of how to structure it. When you rewrite a project, you’re forced to throw away that old structure and create a new one, but the mind keeps referring back to the old structure and functionality, at which point you have to think doubly hard and it gets too frustrating for most people there.

But cleanups means that you’re slowly ripping away old pieces and putting new ones in. It keeps the app working (more or less) so you have a tangeble view of how everything is changing, and you know it’s still working. It’s like if you have a building, and you did a systematic renovation by redoing the walls, then redoing the roof, the floors, the equipment inside, etc… you can still be in the building whilst it’s happening and you get a full view of how it works!

So I think I’m much happier with the term cleanups than rewrites.

(It could be noted that the project I was working on before, duplex, underwent a rewrite and that never completed either, but that’s just because I didn’t have time to finish it. But I’m pretty sure that it applies more or less. It has a successor project under a new name, but that’s a new project entirely, so yeah.)