|
Good code is easy to change.
–Manuel Klimek
|
I strongly agree with Manuel. Keep in mind that you write code for somebody else to modify. If it is not easy to do so, then your code is not good! Remember that maintainance is 70%+ of the project’s life. If you cannot make modifications easily, then you really are wasting time. It’s good to keep that in mind when you’re rushed and “hacking” instead of producing good code. In the end, you pay handsomely if you speeded initially.
Some excerpts from Manual’s excellent blog entry.
Make the code easy to change. This means modularity, abstraction, low coupling and high cohesion and all the other wisdoms of software development that are known for ages.
Find the model that fits best for your team and make the code easy to change so that the poor souls that will maintain yourcode when you leave earth on your mission to Pluto are able to refactor it to make change even more easy for themselves.
An automated test suite makes it easier to change the system without breaking it. Even if you never implemented a newfeature and later realized that you’ve broken a different feature, remember that you write code not for yourself, but forother people who have to maintain your code.