About Me

I am a computer programmer. I do programming professionally and for a laugh.

Technical stuff on programming, java, DSLs, etc...

Tuesday, 6 September 2011

The death spiral of refactoring

Surely you must have seen this;

You are leisurely cruising your beautiful code. Then suddenly you come across a bit that does not feel that great. You think, ‘Right, it is time to restore the universal harmony of the code flow’. You have a better idea and start to pursue it. Code along for a while and suddenly you start to get flash backs of the time you had exactly the same idea (typically a few month back). You already coded it and it did not work for some reason that does not occur to one at the first look.

How to avoid this? Well surely you can consider not re-factoring working code, which is always good practice.

What I do is leave notes to myself:-

//NOTTODO However appealing it looks, doing blah blah blah does not quite work as for such and such

So rather than wasting valuable time, I check a few other things.

No comments:

Post a Comment