Investing into code improvement is a dual edged sword: on the one hand you know that if you don’t improve your code you’ll get slower over time. On the other hand improving your code does not deliver tangible value to your users. So how do you know whether you’re on track?
Track the time a user story needs from idea to production
If that time is getting longer you’re off track: your code is slowing you down. It’s time to invest more into improving your code.
Measure the number of bugs per code push
If that number increases, you’re investing too less into code quality. Build quality in by writing automated tests upfront and by streamlining your code base. Rip out over-complicated stuff which people fear to touch because it breaks every time they do.
Are you spending too much time gold plating your code?
If the above measures do not move in the right direction even though you’re trying to keep your code as clean as possible you’re optimizing the wrong stuff. Try to find those areas in your code which are worth improving and focus your improvement efforts there.
Don’t try to improve stuff which is never touched again
It’s only worth changing even the worst piece of code if you’re going to touch it again. While it sounds like a good idea to ensure that all your code adheres to your coding standards, that’s not feasible most of the time.
Make sure you put the right measures in place to find out whether you’re investing too much or too less into improving your code. What is your strategy to balance new features against code improvements? Please leave a comment below.