Friday, December 14, 2007

What PHP Got Right

While I may pick on PHP every once and a while, I do have to say they got at least one thing right: The Docs.

First, the comments in the manual are terrific. There's a remarkable amount of useful code that has been contributed there. Take the docs on the require_once function. In the comments is useful chunk of code that explains how to get a relative version of this function. That certainly saved me a good block of time.

The other aspect of the site that I love is their URL scheme. Essentially, you can visit the URL:

  http://php.net/<keyword>

and you'll be taken to just the right part of the site. It's a simple hook into the site search functionality, but it's beautifully done. I find myself typing URLs like:

http://php.net/explode - figure out the right order of the arguments to explode
http://php.net/gd - Learn about all the functions offered in the gd package.
http://php.net/array_length - There is no function array_length, that was just a guess. The site brings me to search results instead of a 404 page.

The result is that the site almost has a command line feel to it. Rather than scouring Javadoc pages, I just hit they key sequence Alt + d and start typing away.

No comments:

Post a Comment