<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bin-Blog &#187; documentation</title>
	<atom:link href="http://www.bin-co.com/blog/tag/documentation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bin-co.com/blog</link>
	<description>Learn about the latest in Web Development - as soon as I do.</description>
	<lastBuildDate>Tue, 13 Oct 2009 18:55:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Python Reference Manual has a lot to Learn From PHP</title>
		<link>http://www.bin-co.com/blog/2008/06/python-reference-manual-has-a-lot-to-learn-from-php/</link>
		<comments>http://www.bin-co.com/blog/2008/06/python-reference-manual-has-a-lot-to-learn-from-php/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 18:34:49 +0000</pubDate>
		<dc:creator>Binny V A</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[manual]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[reference]]></category>

		<guid isPermaLink="false">http://www.bin-co.com/blog/?p=110</guid>
		<description><![CDATA[Unlike the other scripting languages I work with(like PHP, Ruby, JavaScript, etc.), I am not comfortable using Python. I have made some stuff in Python(for example, frees) &#8211; but I could get into the flow as easily as with other languages. For the longest time, I thought it was because of the whitespace issue. But [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bin-co.com/blog/wp-content/uploads/2008/03/python-logo.gif" alt="" title="Python Logo" width="211" height="71" class="alignnone wp-image-97 intro" align="right"  /></p>
<p class="intro">Unlike the other scripting languages I work with(like PHP, Ruby, JavaScript, etc.), I am not comfortable using Python. I have made some stuff in Python(for example, <a href="http://lindesk.com/2008/04/frees-hard-disk-drives-free-space-viewer/">frees</a>) &#8211; but I could get into the flow as easily as with other languages. For the longest time, I thought it was because of the whitespace issue. But recently, I created a small Python script &#8211; that&#8217;s when I understood that whitespace does not concern me. <strong class="highlight">What make me angry at python is its documentation/manual</strong>.</p>
<p>By Python Manual, I mean the official Python Manual available at <a href="http://docs.python.org/">http://docs.python.org/</a>. I have <strong class="highlight">downloaded the entire <a href="http://www.python.org/doc/2.5.2/download/">manual to my system as HTML files</a> and use that as a reference</strong> when working with Python. This is what I have done for all the other languages I work with&#8230;</p>
<ul>
<li><a href="http://perldoc.perl.org/">Perl</a></li>
<li><a href="http://www.php.net/manual/en/">PHP</a></li>
<li><a href="http://www.ruby-doc.org/docs/ProgrammingRuby/">Ruby</a></li>
<li><a href="http://docs.sun.com/source/816-6408-10/">JavaScript</a> </li>
<li><a href="http://www.w3.org/TR/REC-CSS2/">CSS</a></li>
<li>etc.</li>
</ul>
<h2>Finding a Function</h2>
<p>There is one big problem with using HTML files as your reference &#8211; you cannot search through it. So I try to find a page in the documentation that <strong class="highlight">lists all the functions in a single page</strong>. When I need to find a function, all I have to do is <strong class="highlight">search through this page</strong>. These pages in the documentation serves this purpose&#8230;</p>
<ul>
<li><a href="http://www.php.net/manual/en/indexes.php">PHP</a></li>
<li><a href="http://perldoc.perl.org/index-functions.html">Perl</a></li>
<li><a href="http://docs.sun.com/source/816-6408-10/bklast.htm">JavaScript</a></li>
<li><a href="http://www.ruby-doc.org/docs/ProgrammingRuby/html/builtins.html">Ruby</a></li>
</ul>
<p>What about Python? Well, <strong class="highlight">Python don&#8217;t have such a page</strong> in their manual. The nearest one I could find a combination of four pages &#8211; <a href="http://docs.python.org/modindex.html">Module Index</a> + <a href="http://docs.python.org/lib/genindex.html">Library Index</a> + <a href="http://docs.python.org/tut/node19.html">Tutorial Index</a> + <a href="http://docs.python.org/ref/genindex.html">Language Index</a>. Its no where near as useful.</p>
<p>Even if you are online(remember, many people are not connected all the time), its still <strong class="highlight">not easy to find a function in Python documentation &#8211; even with searching</strong> capabilities. Don&#8217;t believe me? OK &#8211; go to <a href="http://docs.python.org/">Python Docs</a> and try to find the documentation for the function that, say, reverses an array. Now go to the <a href="http://php.net/manual/en/">PHP site</a> and do the same.</p>
<h2>Reference Formats</h2>
<p>Anyway, I cannot really complain about the the availability of the &#8216;function page&#8217;. Its just the way I prefer &#8211; other people may not want such a page. But I can complain about the fact that <strong class="highlight">they don&#8217;t provide a CHM file</strong> in their <a href="http://www.python.org/doc/2.5.2/download/">downloads section</a>. CHM solves the problem as you can search through them easily.</p>
<p>PHP, on other hand, <a href="http://www.php.net/download-docs.php">provides the CHM file</a>. This makes the PHP manual much more easier to use.</p>
<p>Even though Python don&#8217;t officially provide a CHM file, others have made it available on the net. Its just a <a href="http://www.google.com/q=python+reference+chm">google search away</a>. But I prefer to get these stuff from an official source.</p>
<h2>Level of Detail in the Documentation</h2>
<p>The worst sin of the Python manual is that the <strong class="highlight">documentation is not detailed enough</strong>. To better understand this, let&#8217;s take an example &#8211; say the array reversal function. First we take a look at the Python <a href="http://docs.python.org/lib/module-array.html#l2h-779">documentation for this function</a>&#8230;</p>
<dl>
<dt>reverse()</dt>
<dd>Reverse the order of the items in the array.</dd>
</dl>
<p>One line. That&#8217;s it! If you are not well versed in Python, you will have no idea of how to use this function &#8211; because there is no example. Most people will expect that the array must be given as the argument. But the argument list is empty in the documentation. That&#8217;s because the array is not passed as an argument &#8211; rather, in Python, this function is a member function of the array object &#8211; so the proper usage will be something like this&#8230;</p>
<pre><code class="python">x = [1,2,4]
x.reverse()
#Now x has the value [4,2,1]</code></pre>
<p>I know that because I know Python &#8211; but if a new user manages to find the documentation for this function, he will be confused. Another thing &#8211; I am not saying that there are no examples in the documentation &#8211; examples are given for a lot of functions. But its no where near the level that PHP has achieved.</p>
<p>OK &#8211; now lets see the PHP manual for the same function &#8211; <a href="http://php.net/manual/en/function.array-reverse.php">array_reverse()</a>. There is an entire page for that function. Not just for this function &#8211; there is <strong class="highlight">one page of documentation for every function</strong> in PHP. And <strong class="highlight">there are examples</strong>. And at the end, <strong class="highlight">there is a collection of &#8216;user notes&#8217;</strong> &#8211; making each function much clearer. Beautiful!</p>
<p>I feel a bit guilty about comparing Python with PHP documentation &#8211; <strong class="highlight">PHP has the best documentation in its class</strong> of languages. But still, Python has a lot to learn from PHP(I wanted to say that for a long time <img src='http://www.bin-co.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  ).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bin-co.com/blog/2008/06/python-reference-manual-has-a-lot-to-learn-from-php/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>

