5 ms·
I'd agree with this, but from an unusual perspective - I write some really, really bad PHP. So I thought I'd offer some perspective on where this actually come
by soneil 12y ago
I'd agree with this, but from an unusual perspective - I write some really, really bad PHP. So I thought I'd offer some perspective on where this actually comes from (from a sample set of 1).
PHP's documentation is almost too good. It's fantastic. My primary frustration dabbling with other languages is that no-one else has not only the language itself, but a huge subset of the core library documented to the standard that I've come to rely on from PHP.
But here also lays a huge problem. I'm not a programmer. I have next to no idea what MVC is, let alone what would qualify it as sensible. When it comes to architecture, I could give you a much more convincing description of flying buttresses than anything you'd hope to find in a codebase.
But what I can do, is break what I want to do down into small enough component tasks that I can find very workable examples within the PHP documentation, and then duct-tape these all together until I've accomplished my goal.
Now, the good news is that I know this is a terrible approach with terrible results, so I wouldn't dream of inflicting my results upon anyone else. But I thought I could offer a little insight onto how PHP enables such atrocities.
It's similar to the popular backlash against Bootstrap. Where Bootstrap enables me to kludge together a frontend with near no idea what I'm doing, PHP's documentation does the same for the backend. But I still find it difficult to blame the products themselves - I'm more than aware that this is my failing.
- lmm 12y agoIs 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.