The code should tell the story
October 31, 2006 | 1:41 pmSo you are a developer and create programs. Believe it or not, someone will come after you and work on your code. We should write our code for those that come after us. Documentation is often neglected in projects or is too far from the code, so that when the code changes, documentation does not.
A step in the right direction is that we let the code tell the story. As you write, you choose names that speak. Your coding of algoritms and solutions should be obvious. Educate yourself in the conventions, best practises and patterns of the language you use. Don’t use smart coding if you are not forced to do it for performance reasons. If you make design decisions, add why you did as you did. Reveal your thinking in the code. Add the purpose of your methods as comments. Always write comments and code together and at the same time. I can guarantee that what you plan to add afterwards, is never done.
If you have done smart-coding, someone will spend a lot of hours trying to understand how it works. Imagine how much time, effort and money that is wasted this way. The time you save when you take a short cut is lost three times when someone after you will continue to work on your application.
See your code as a living thing. It will continue to live after you have left it. Our attitude and perception of the works of our hands is what will rule and govern our habits.










