I usually write out my comments first because it lets me define what I'm trying to do. The code should be a reflection of the comments.
On 08/12/2007, Greg Ewing <[EMAIL PROTECTED]> wrote: > > Ian Mallett wrote: > > When writing code, it is good to have comments, but it is not usually > > wise to put them in until you've tested the relevant code. > > Although sometimes it can be helpful to write a comment > beforehand as a sort of mini design document, to help > clarify your thoughts about what the code needs to > accomplish and how you intend to go about it. > > If you later change the code in a way that invalidates > the comment, you should of course update the comment > to match. > > -- > Greg > -- Science is open source religion