by lmm · 11y ago · 0 comments
Is it just that something like Django requires a bit of up-front install, whereas PHP you can write <?php in a file on your shared webhost and be rolling? Am I wrong about the documentation being up to the same standards? Or is there something else going on?
(This is coming from a guy that does understand PHP very well, also MVC, objects, "patterns" even though I personally think that word is absurd :P)
Here's an example I ran into recently, taking my first babysteps into Python: https://docs.python.org/2/library/json.html vs http://php.net/manual/en/function.json-encode.php
As far as I can tell, these should be functionally similar, at least for my goal of returning an array as json.
The first thing to compare is the very first line - where the php docs tell me quite clearly what this function does. Compare to what I can only call waffle on the Python docs.
The php docs go on to tell me: what the arguments are, what types they are, and what options are acceptable. Followed by examples that start with the very basic, and go on to cover some more involved scenarios - but are all self-documenting and standalone.
The Python docs start off with some examples that frankly, aren't self-documenting. I'm still not sure what type is being passed, or returned, in the first example. The following examples appear to be trying to cover some edge cases, but don't say what, or why. This for me is the huge difference - the documentation is the last place I expect to be trying to guess what they mean.
We them get into the "basic usage" section where my eyes frankly glaze over.
It seems the Python docs to go into a lot more depth, so could be called better-documented from that point of view. But my original argument was that the PHP docs are incredibly accessible, and I stand by that.