05-22-2008, 11:12 PM
|
#3 (permalink)
|
|
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
|
I'm crazy when it comes to commenting, and not because I'm worried about other programmers, since other programmers generally don't have their hands on my work at this point - it's for my own purposes that I comment, because no matter how into a particular method I am at the time, where I can see everything visually working together in my head, and it flows like this mornings coffee, two weeks later I can come back to something and sit there cross eyed for half an hour trying to figure out what I did if I didn't comment it.
There's three types of comment constructors (delimiters? hmm) you can use in PHP, just to rehash, there's /* -- */, // and #. Typically I use the /* version for the large descriptive comments I use at the beginning of all my library files, and for method comments (where I list the function name, the arguments it takes and what it should return, along with an area for notes as I'm in the development process) and then I'll use // for comments that are littered about elsewhere.
This is just one way of going about it. The actual correct way to do it... is... wait for it... however you want. What looks best? What's most readable? If it winds up adding more clutter and making your readability go down, then chances are you should try another way.
-m
|
|
|
|