<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: On the Perils of Inline API Documentation</title>
	<atom:link href="http://www.procata.com/blog/archives/2007/04/13/on-the-perils-of-inline-api-documentation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.procata.com/blog/archives/2007/04/13/on-the-perils-of-inline-api-documentation/</link>
	<description>PHP Programming, Web Development, PHP Advocacy and PHP Best Practices.</description>
	<lastBuildDate>Sun, 14 Mar 2010 11:08:56 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: my blog</title>
		<link>http://www.procata.com/blog/archives/2007/04/13/on-the-perils-of-inline-api-documentation/#comment-84600</link>
		<dc:creator>my blog</dc:creator>
		<pubDate>Thu, 02 Jul 2009 12:37:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.procata.com/blog/archives/2007/04/13/on-the-perils-of-inline-api-documentation/#comment-84600</guid>
		<description>&lt;strong&gt;check this out...&lt;/strong&gt;

this is mine...</description>
		<content:encoded><![CDATA[<p><strong>check this out&#8230;</strong></p>
<p>this is mine&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Philipp Scheit</title>
		<link>http://www.procata.com/blog/archives/2007/04/13/on-the-perils-of-inline-api-documentation/#comment-83568</link>
		<dc:creator>Philipp Scheit</dc:creator>
		<pubDate>Sun, 30 Mar 2008 10:40:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.procata.com/blog/archives/2007/04/13/on-the-perils-of-inline-api-documentation/#comment-83568</guid>
		<description>I fully agree to the point, that doc blocs can be very annyoing while coding, but as said above meta data is one aspect, that is very important.

I think it&#039;s better to concentrate on the &quot;important&quot; Doc Blocs - which are on class Level and Method level. Well named properties (and params) can be left with a minimum of documentation. I only write more detailed documentation, when i leave the standard path of doing things.
For example i&#039;ve got a lot of DB ids in my classes - which are always Integer greater 0 and can&#039;t be negative. That&#039;s why i often only put the &quot;@return&quot; and the &quot;@param  $param&quot; information into my documentation, because in phpDocumentor the &quot;getId()&quot; getter would return void as default.

/**
 * @return int
 */
public function getId() { ..

/**
 * @param int $id
 */
public functiion setId() { ...

easy to read and doesn&#039;t waste much time..</description>
		<content:encoded><![CDATA[<p>I fully agree to the point, that doc blocs can be very annyoing while coding, but as said above meta data is one aspect, that is very important.</p>
<p>I think it&#8217;s better to concentrate on the &#8220;important&#8221; Doc Blocs &#8211; which are on class Level and Method level. Well named properties (and params) can be left with a minimum of documentation. I only write more detailed documentation, when i leave the standard path of doing things.<br />
For example i&#8217;ve got a lot of DB ids in my classes &#8211; which are always Integer greater 0 and can&#8217;t be negative. That&#8217;s why i often only put the &#8220;@return&#8221; and the &#8220;@param  $param&#8221; information into my documentation, because in phpDocumentor the &#8220;getId()&#8221; getter would return void as default.</p>
<p>/**<br />
 * @return int<br />
 */<br />
public function getId() { ..</p>
<p>/**<br />
 * @param int $id<br />
 */<br />
public functiion setId() { &#8230;</p>
<p>easy to read and doesn&#8217;t waste much time..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron Saray</title>
		<link>http://www.procata.com/blog/archives/2007/04/13/on-the-perils-of-inline-api-documentation/#comment-81896</link>
		<dc:creator>Aaron Saray</dc:creator>
		<pubDate>Sun, 17 Jun 2007 00:28:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.procata.com/blog/archives/2007/04/13/on-the-perils-of-inline-api-documentation/#comment-81896</guid>
		<description>A technique I use for generating API documentation is using the &#039;@access&#039; tag.  This allows me to put some comments as @access private - which doesn&#039;t get included in some documentation (if you compile your documentation with specific switches).</description>
		<content:encoded><![CDATA[<p>A technique I use for generating API documentation is using the &#8216;@access&#8217; tag.  This allows me to put some comments as @access private &#8211; which doesn&#8217;t get included in some documentation (if you compile your documentation with specific switches).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Premature Optimization &#187; Premature Optimization and The Web</title>
		<link>http://www.procata.com/blog/archives/2007/04/13/on-the-perils-of-inline-api-documentation/#comment-81467</link>
		<dc:creator>Premature Optimization &#187; Premature Optimization and The Web</dc:creator>
		<pubDate>Mon, 07 May 2007 19:35:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.procata.com/blog/archives/2007/04/13/on-the-perils-of-inline-api-documentation/#comment-81467</guid>
		<description>[...] These thoughts are not revolutionary, but I think they make an important note, especially today when code generation is so popular, PHP source code to C extension conversion pops up again, and claims that source code documentation is overrated are heard (here and here). [...]</description>
		<content:encoded><![CDATA[<p>[...] These thoughts are not revolutionary, but I think they make an important note, especially today when code generation is so popular, PHP source code to C extension conversion pops up again, and claims that source code documentation is overrated are heard (here and here). [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff</title>
		<link>http://www.procata.com/blog/archives/2007/04/13/on-the-perils-of-inline-api-documentation/#comment-81404</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Mon, 16 Apr 2007 18:57:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.procata.com/blog/archives/2007/04/13/on-the-perils-of-inline-api-documentation/#comment-81404</guid>
		<description>Docblocks as meta data is one aspect I didn&#039;t consider when I wrote this.</description>
		<content:encoded><![CDATA[<p>Docblocks as meta data is one aspect I didn&#8217;t consider when I wrote this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SvenSchoene.de</title>
		<link>http://www.procata.com/blog/archives/2007/04/13/on-the-perils-of-inline-api-documentation/#comment-81397</link>
		<dc:creator>SvenSchoene.de</dc:creator>
		<pubDate>Sat, 14 Apr 2007 17:17:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.procata.com/blog/archives/2007/04/13/on-the-perils-of-inline-api-documentation/#comment-81397</guid>
		<description>&lt;strong&gt;Another point-of-view regarding â€œdocblocking your codeâ€&lt;/strong&gt;

Jeff Moore has written a comment to this blog entry from Travis Swicegood in which he basically says that inline-documentation of PHP-code is useless, since code is self-explanatory, especially if you have unit-tests that go with your code.
I can partl...</description>
		<content:encoded><![CDATA[<p><strong>Another point-of-view regarding â€œdocblocking your codeâ€</strong></p>
<p>Jeff Moore has written a comment to this blog entry from Travis Swicegood in which he basically says that inline-documentation of PHP-code is useless, since code is self-explanatory, especially if you have unit-tests that go with your code.<br />
I can partl&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ilija Studen</title>
		<link>http://www.procata.com/blog/archives/2007/04/13/on-the-perils-of-inline-api-documentation/#comment-81396</link>
		<dc:creator>Ilija Studen</dc:creator>
		<pubDate>Sat, 14 Apr 2007 13:42:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.procata.com/blog/archives/2007/04/13/on-the-perils-of-inline-api-documentation/#comment-81396</guid>
		<description>One of the best advantages of docblocks it that some IDE-s can understand them and offer you additional functionality based on data they get from docblocks. For instance:

&lt;code&gt;/**
 * Do stuff
 *
 * @param FirstClass $object
 * @return SecondClass
 */
function do_stuff($object) {
  // do stuff
}&lt;/code&gt;


Zend Studio will know what $object is and what do_stuff() returns and provide you with code completion for $object var and returned value. Being a code completion junky I find this really helpful and because of that I document almost everything.</description>
		<content:encoded><![CDATA[<p>One of the best advantages of docblocks it that some IDE-s can understand them and offer you additional functionality based on data they get from docblocks. For instance:</p>
<p><code>/**<br />
 * Do stuff<br />
 *<br />
 * @param FirstClass $object<br />
 * @return SecondClass<br />
 */<br />
function do_stuff($object) {<br />
  // do stuff<br />
}</code></p>
<p>Zend Studio will know what $object is and what do_stuff() returns and provide you with code completion for $object var and returned value. Being a code completion junky I find this really helpful and because of that I document almost everything.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Edward Z. Yang</title>
		<link>http://www.procata.com/blog/archives/2007/04/13/on-the-perils-of-inline-api-documentation/#comment-81394</link>
		<dc:creator>Edward Z. Yang</dc:creator>
		<pubDate>Sat, 14 Apr 2007 01:07:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.procata.com/blog/archives/2007/04/13/on-the-perils-of-inline-api-documentation/#comment-81394</guid>
		<description>As with all documentation, docblocks can be extremely helpful, or a hindrance to programmers trying to figure out the program. I find that docblocks are a great place to clear up any ambiguity that may be in the method name: I expect that the method name is fairly explanatory and not doFoo()

Detailing the format of parameters, as Matthew notes, is essential. Unlike method names, these are not always immediately obvious, and usually can be greatly helped if there are a few examples too.

In the end, however, I think PHP&#039;s documentation is a &quot;docblock&quot; like standard to aspire to. After generating skeleton XML files from the source C code, manual writers then fill in lots more tasty tidbits about the PHP functions. Done correctly, its a godsend.</description>
		<content:encoded><![CDATA[<p>As with all documentation, docblocks can be extremely helpful, or a hindrance to programmers trying to figure out the program. I find that docblocks are a great place to clear up any ambiguity that may be in the method name: I expect that the method name is fairly explanatory and not doFoo()</p>
<p>Detailing the format of parameters, as Matthew notes, is essential. Unlike method names, these are not always immediately obvious, and usually can be greatly helped if there are a few examples too.</p>
<p>In the end, however, I think PHP&#8217;s documentation is a &#8220;docblock&#8221; like standard to aspire to. After generating skeleton XML files from the source C code, manual writers then fill in lots more tasty tidbits about the PHP functions. Done correctly, its a godsend.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Weier O'Phinney</title>
		<link>http://www.procata.com/blog/archives/2007/04/13/on-the-perils-of-inline-api-documentation/#comment-81391</link>
		<dc:creator>Matthew Weier O'Phinney</dc:creator>
		<pubDate>Fri, 13 Apr 2007 18:30:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.procata.com/blog/archives/2007/04/13/on-the-perils-of-inline-api-documentation/#comment-81391</guid>
		<description>While naming things well is important, I still find I like docblocks for a couple of things:

&lt;ul&gt;
&lt;li&gt;Brief, one sentence summaries of what a method does. Other than that, let the code do the talking&lt;/li&gt;
&lt;li&gt;If any parameters are associative arrays, I like to document the array keys expected, as there&#039;s no other way of really knowing that information unless you delve into the code itself&lt;/li&gt;
&lt;/ul&gt;

Also, it&#039;s good to remember that docblocks are not just for API documentation. Many IDEs will be able to use the docblock to provide information on parameter typehints, and, using the reflection API, that same information can be used to do autodiscovery on classes used for things such as web services, MVC controllers, etc.

That said, probably the best documentation you can do is as Travis suggests: write good tests. If you write tests that test and describe the purpose of an interface, i.e., the contract it&#039;s following, it&#039;s much easier for a developer to go in and see &lt;em&gt;how&lt;/em&gt; the class should be used.  Furthermore, some testing frameworks, e.g. PHPUnit, have the ability to create &quot;Agile Documentation&quot; from tests that use the test name to generate documentation; this can often be very useful to a developer as well.</description>
		<content:encoded><![CDATA[<p>While naming things well is important, I still find I like docblocks for a couple of things:</p>
<ul>
<li>Brief, one sentence summaries of what a method does. Other than that, let the code do the talking</li>
<li>If any parameters are associative arrays, I like to document the array keys expected, as there&#8217;s no other way of really knowing that information unless you delve into the code itself</li>
</ul>
<p>Also, it&#8217;s good to remember that docblocks are not just for API documentation. Many IDEs will be able to use the docblock to provide information on parameter typehints, and, using the reflection API, that same information can be used to do autodiscovery on classes used for things such as web services, MVC controllers, etc.</p>
<p>That said, probably the best documentation you can do is as Travis suggests: write good tests. If you write tests that test and describe the purpose of an interface, i.e., the contract it&#8217;s following, it&#8217;s much easier for a developer to go in and see <em>how</em> the class should be used.  Furthermore, some testing frameworks, e.g. PHPUnit, have the ability to create &#8220;Agile Documentation&#8221; from tests that use the test name to generate documentation; this can often be very useful to a developer as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Bowers</title>
		<link>http://www.procata.com/blog/archives/2007/04/13/on-the-perils-of-inline-api-documentation/#comment-81390</link>
		<dc:creator>Jeremy Bowers</dc:creator>
		<pubDate>Fri, 13 Apr 2007 17:34:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.procata.com/blog/archives/2007/04/13/on-the-perils-of-inline-api-documentation/#comment-81390</guid>
		<description>I&#039;ve focused on putting more stuff in the module/class/higher level documentation, and leaving the API documentation for just the API. After all, the most important thing documentation can do is explain the core design and purpose, not how to call the methods with no coherency.

For example, here&#039;s &lt;a href=&quot;http://www.jerf.org/programming/nonmockobjects_doc/&quot; rel=&quot;nofollow&quot;&gt;a doc-book-like documentation&lt;/a&gt; of a project I&#039;ve released. The top-level documentation is more like a tutorial and design doc than traditional API docs, and I hope they are actually useful.

Doc-book-style documentation can still be useful, but you have to deliberately make sure to have a flow to the docs beyond the default non-flow.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve focused on putting more stuff in the module/class/higher level documentation, and leaving the API documentation for just the API. After all, the most important thing documentation can do is explain the core design and purpose, not how to call the methods with no coherency.</p>
<p>For example, here&#8217;s <a href="http://www.jerf.org/programming/nonmockobjects_doc/" rel="nofollow">a doc-book-like documentation</a> of a project I&#8217;ve released. The top-level documentation is more like a tutorial and design doc than traditional API docs, and I hope they are actually useful.</p>
<p>Doc-book-style documentation can still be useful, but you have to deliberately make sure to have a flow to the docs beyond the default non-flow.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
