On 5/22/07, Matthew Weier O'Phinney <[EMAIL PROTECTED]> wrote:
-- till <[EMAIL PROTECTED]> wrote (on Tuesday, 22 May 2007, 05:15 PM +0200): > On 5/22/07, Andries Seutens <[EMAIL PROTECTED]> wrote: > > till schreef: > > > was wondering what the best practise for comments inside the code is. > > > I know that on classes/methods you use a Javadoc block, but what about > > > inline? > > > > > > For example: > > > > > > /** > > > * ... > > > */ > > > function foo() > > > { > > > // Some comment here > > > $bar = 'whatever'; > > > } > > > > > > Is it totally acceptable to do this ("// Some comment here"), or is > > > there anything else to do instead. Or should I do a full Javadoc block > > > as well? > > > > Inline comment should have a single star instead of. eg: > > Is this a standard? On PEAR it seems to be a full docblock if you have > a multiline comment.http://pear.php.net/manual/en/standards.comments.php: "Non-documentation comments are strongly encouraged... C style comments (/* */) and standard C++ comments (//) are both fine." I.e., for non-documentation comments (i.e., if it's not meant to be parsed by PhpDocumentor or would not be parsed by it), use either standard C style multi-line comments or C++ style single line comments.
Thanks for that!
