Jump to content

Comment conventions for functions/methods


nloding

Recommended Posts

I've Googled, but can't find a 'definition' anywhere.  I see all the time the @param, @return, @package, etc. items in comments surrounding variables and functions, specifically in class definitions.  Is there a 'standard' of any sort for this?

 

I'm looking at releasing out a few templates and classes and want to clean them up a bit and make then a bit more 'standard', especially in the definition of the class methods.

 

What do you guys use, if any?  When I publish C# code, I use the <summary>, <param>, <return>, etc. tags before the functions.  I would like to do the same with my PHP code.

I comment lightly for myself.  I believe that code should be written well enough that little to no commenting is needed.  However, if I'm going to publish this class, I would like to have some sort of description for it.

 

Here's an example of the commenting I'm looking for, and I might just copy what he did.  I am curious if there's a standard though:

 

http://mike.teczno.com/JSON/JSON.phps

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.