This question is inspired by the following sources:
- Clean code by Robert C. Martin
- Agile Principles, Patterns, and Practices in C# by Robert C. Martin and Micah Martin
- What is software design? by Jack W. Reeves
- My current project (where we should comment everything in the code)
Mr. Reeves states in his paper that the code is the design and the compiler is doing the atual build, that is, we, the developers, do the actual design when we coding. So do we need to write the design document before we start coding? Should we comment everything we write in code? I think not. Take the following simple example:
//<summary>
// True if object is deleted
//</summary>
public bool IsDeleted() {...}
Isn't the comment just noise? What do it add to the code that the function name doesn't already says? And how do we keep that documentation, and design documentation, up to date? When doing are test, debug and fix we will most likely change the code and design... but will we change the design document? Many of us will most likely forget to update the design document because it is not the real design document, the code is.
So how do we create good documentation? Write good code that conforms to the SOLID principles (if object oriented programming), and also write your code so you can read it, that is use proper names.
So what do you say? How much documentation do we need? When should we write it? How do we maintain it?