News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Andrew Podner:
Intro to PHP Comments and Docblocks
January 28, 2013 @ 09:21:58

If you've ever looked at your code an wondered about its commenting, if there was a kind of "best practice" to follow when it comes to its structure, you should read this article from Andrew Podner about docblocks.

The subject is how to properly document code with PHP comments and docblocks. This one took a while for me to really just accept as a part of the development process. To me now, the comments are now just as much a part of the application as the code is. I believe it is that important. With IDE's today, there really is no reason not to have good documentation in your source code.

He talks some about his own reluctance at first to use comments and how it helped him remember what his thought process was behind parts of this code. He includes an example of a typical docblock structure, showing the general description, parameters and a "return" value. He also includes something interesting in the topic of documentation - good variable names. There's links included to two tools that can take these standardized comments from your code and build HTML documentation from it - phpDocumentor and ApiGen.

You can find out more about the PHP docblock standards from this site.

0 comments voice your opinion now!
comments docblocks introduction phpdocumentor


blog comments powered by Disqus

Similar Posts

Debuggable Blog: Unit Testing in CakePHP Part 1 - Introduction to Unit Testing

DevShed: Performing Basic Tasks with MySQL 4.1 and Above, using mysqli with PHP 5

Zend Developer Zone: Getting started with CouchDB : meet PHP on Couch

ServerGrove Blog: Deployment of Symfony2 applications with Ansible

PHPBuilder.com: Exploring PHP Design Patterns


Community Events





Don't see your event here?
Let us know!


podcast api code developer introduction unittest install wordpress bugfix application threedevsandamaybe series list library release configure community language laravel interview

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework