4 ms·
Is it really that much better? I've found e.g. the Python documentation for the core library is very good. It seems to me that it should be possible to slap tog
by lmm 12y ago
Is it really that much better? I've found e.g. the Python documentation for the core library is very good. It seems to me that it should be possible to slap together some Django approximately as easily as PHP, and you'd end up with something a little bit better.
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?
- mtbcoder 12y agoLaravel (or any other PHP framework) also requires an "up-front install", but you don't need a framework like Django to "slap" together a Python program for web purposes either. What you need is an understanding of what a CGI application does and how to deploy one with your favorite web server. Deploying a Python application with Apache/mod_wsgi (or nginx/uwsgi) is really no more difficult than deploying a PHP application with Apache/PHP-FPM or FastCGI.
- bitJericho 12y agoI don't think you can apt-get install python and expect to be running a webserver. But I think we can all agree that running a python web app (properly) is 10 times easier than ruby.
- mtbcoder 12y agoTrue, but by doing apt-get install php you won't be up and running either. My point was really to clarify that you don't need a full blown framework to run basic Python scripts for web programming purposes and also to state that the barrier to entry for Python isn't really that much higher than PHP.
- marrs 12y agoWith PHP you don't need any of that. All you need is to rename your index.html to index.php and re-upload. The learning curve is incredibly shallow.
- bitJericho 12y agoI think PHP has some of the best documentation I've ever come across. Particularly the comments section for every single command is incredibly helpful. I've learned tons and tons just from the comments. I think any programming language would be much improved if they copy PHP's documentation model. (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)
- soneil 12y agoI guess this part is pretty subjective, but I do find PHP's docs more readable. Here's an example I ran into recently, taking my first babysteps into Python: https://docs.python.org/2/library/json.html https://docs.python.org/2/library/json.html vs http://php.net/manual/en/function.json-encode.php 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.
- mkesper 12y agoI always found Python docs very readable. Did you try the tutorial? Oh, and do yourself a favour and start with Python3.