Its the time when I started my career.. and a certain gentleman named Asokan, who was helping us getting started with Programming said:
“Your programs are supposed to function. They need to provide the right output. But, your work as a programmer doesn’t stop with that.”
There’s always a tendency to stop improving things once they’ve started to work. I’ve experienced this on many occasions where we released software as soon as it just started working. Then there is this over-celebrated QA team, that does some quality check and boom.. the customer has it in his hands. And it breaks (well, not always.. practically only 99% of the times) . We find ourselves spending pretty much the same time as we took to write the code, fixing it. Well.. we don’t learn. We follow the same cycle as above. It just has to work. isn’t it?
Well.. the truth is that stuff breaks. In software, it sure breaks like hell. So the wise decision is to be ready for it. Now, its not that we do it on purpose. Sometimes we’re not well informed, not experienced enough, are bounded by self-imposed time constraints. Most of the times.. we just don’t care.
So what can we do?
Give the code a second look.. (once its started working). Its not a crime to write ugly code to get stuff working. Its advised not to get into the habit of clean stuff.. and forget the actual solution. So get it working first. Then pause. Stop for a while. Its working now. Lets improve it a bit.
Clean stuff up.
Proper names. Rethink names of methods and variables.
Write tests if you’ve not written them yet.
Refactor.. Refactor.. Refactor.
I know there is an urge to release stuff as soon as they’re ready. The stuff above doesn’t take that long anyway. And saves lot of time and money later. Try following this cycle.
Next time you estimate a work, dedicate a little time for revisiting your code too..
Hope it helps.