2010-06-22 01:24 - General
Why I still miss PHP: the manual.I did PHP programming for around six years. Then I switched to Python full time. There's lots to like, and dislike, on both sides. But right now I want to talk about one thing: the manual.
No language is perfect. You might not remember whether it's replace(haystack, needle) or replace(needle, haystack). So hopefully, looking it up is quick and easy. I'm going to use filter as an example. If you remember that the appropriate function in PHP is array_filter a simple search ( https://www.google.com/search?q=php+array_filter ) finds you the page with the documentation for that function in one click.
How about for python ( https://www.google.com/search?q=python+filter )? You get to the "built in functions" page, which lists over 75 different functions. You can probably Ctrl-F it, which is already a lot more work. There's no examples, and it's generally not as helpful.
Did I pick a bad example? How about date/time stuff? PHP: http://www.php.net/manual/en/ref.datetime.php Python: https://www.google.com/search?q=python+datetime . The second example is the same. PHP docs are full of tables-of-contents, and links to narrow down to the thing you actually want now. Python docs are full of dense pages that have no internal navigation, and a lot more complex and generally confusing details. If I look very carefully (okay, if I Ctrl-F), I can find the strptime documentation for Python. But again PHP has better layout, and more useful information.
Python people: telling me that "This is equivalent to datetime(*(time.strptime(date_string, format)[0:6]))" is not helpful. Telling me "See section strftime() and strptime() Behavior." is not helpful, whereas " The format used in date (e.g. the same as used in strftime()). " (both with the appropriate bits linked) is.