Comments (45)

34 Name: #!/usr/bin/anon 2006-02-11 20:58 ID:haVlcBYk

(I'm >>30)

>>31
I can't argue with the fact that this is a fancy name for a very, very simple technique.

>>33
If you express the requirements as unit tests (which is a good practice IMHO), you don't go past the method level, do you ? (i.e. the finest thing you can control is see if a method's effects fits the requirements).

The PPP is basically writing a summary of what your method/routine will do, then write your code after the corresponding comment. Typically you'll get 1-10 lines of code per line of comment, sometimes more if the code is straightforward.

It goes more in-depth than what you would achieve by unit-testing (since it explains the inside of a method), and arguably it may be overkill, but if it's decided on your project that there is a need to comment, it has good points :
_ it ensures comments will be written
_ it ensures only useful comments are written, too - too often have I seen worthless comments such as "// increment i by one" - with the PPP, since you write a summary, if the code is simple you won't write much or at all
_ it is much less boring than writing the comments afterwards - going back and commenting all the code you wrote during the last 10 days is dull, dull, dull

This thread has been closed. You cannot post in this thread any longer.