I have recently submitted our app to the app store after weeks of coding and hacking things to work. At this point I have realized that the quality of code has deteriorated considerably even though it works. The structure of the code is not lost, but in order to make it work, I have put a lot of hacks.
When I look back at the code, I can't believe I have written it and there are 1000 other ways to write it better. But I am hard pressed for time since my team has to ship it fast and validate a few points for our next round.
So I wanted to find out from HN members, how do you keep track of the quality of the code? Do you try to keep it well structured and re-factor your code often? What steps do you take to maintain the quality of the code. I mean, not just writing 'good' code, but what do you do to ensure that it is easily re-factorable?
Of course, we all start out with a clear and rigid vision about how the code should be - you use good design patterns, you let your data dictate the flow of your code and inevitably, some scenario comes up that doesn't play into your structure well and you concede a hack. Then a couple more. But with experience comes being able to identify areas that are more likely to attract smelly code and thus you are able to prepare in advance.
One of the paradigms that I am always reiterating to my team is that their code only needs to be 'good enough' and of course, this is relating to productivity. It doesn't need to be the shiniest example of a memento implementation I ever saw - first and foremost, it needs to work. And it needs to work when I need it to work, not 2 weeks after because you just had to refactor it just one more time. This is the reality of being a professional developer, working with customers.