nloding Posted May 16, 2008 Share Posted May 16, 2008 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. Link to comment https://forums.phpfreaks.com/topic/105949-comment-conventions-for-functionsmethods/ Share on other sites More sharing options...
jonsjava Posted May 16, 2008 Share Posted May 16, 2008 you comment your code? that's definately not standard! *lol*. actually, there prolly is a standard, but only about 2 people in the world use it. Not the best way to code, but it's life. Link to comment https://forums.phpfreaks.com/topic/105949-comment-conventions-for-functionsmethods/#findComment-542957 Share on other sites More sharing options...
nloding Posted May 16, 2008 Author Share Posted May 16, 2008 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 Link to comment https://forums.phpfreaks.com/topic/105949-comment-conventions-for-functionsmethods/#findComment-542960 Share on other sites More sharing options...
947740 Posted May 16, 2008 Share Posted May 16, 2008 I would never comment my code that much unless I was told to do so. :-\ Link to comment https://forums.phpfreaks.com/topic/105949-comment-conventions-for-functionsmethods/#findComment-542963 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.