4 ms·
I code in Python, BASH, C, and PHP on a regular basis and still strongly prefer PHP for everyday coding and hobby tasks. I even prefer to create command-line sc
by asnyder 13y ago
I code in Python, BASH, C, and PHP on a regular basis and still strongly prefer PHP for everyday coding and hobby tasks. I even prefer to create command-line scripts in PHP (though will switch to Python if it's large to begin with). For me getting Flask to work properly under NGINX + uwsgi was such a hassle. Having to tell it what module, and hooking things up to touch versus just passing to PHP under fast cgi.
To be honest, PHP is really just simpler, less hassle, and if you know what you're doing things come out structured well. Just stick to classes (Including statics! There shouldn't be a define() anywhere.), use namespaces, use composer (I've come to really like it), and use a coding standard.
- leokun 13y agoIn what ways is PHP less hassle than Python? I don't understand this argument.
- LeafStorm 13y agoDeployment, for one. sudo apt-get install Apache and PHP, then edit the Apache config to say, "use this directory." I love Django and Flask to pieces, but deploying a Python app is like building a hovercraft compared to PHP.
- leokun 13y agoI have no problems deploying a django app with gunicorn. It's a simple command line statement, and deployment is always an intricate thing, unless you don't have to worry about ssl certs and secrets and keys, and managing access, admin pages, etc etc.
- ericd 13y agoWhich you usually don't for fun personal projects.
- deleted 13y ago[deleted]
- asnyder 13y agoI'm going to say it, better documentation. I don't know, maybe it's just me, but I find it takes me significantly less time do find out how to do something in PHP, or a PHP library than in the corresponding Python. Though, there are obviously exceptions to this.
- TazeTSchnitzel 13y agoOoh, yes. While PHP's docs sometimes promose horrible worst practices, they are more detailed and fleshed out than Python's.
- debaserab2 13y agoI don't think it's less of a hassle than PHP, but in the context of web development, it is. In PHP, your development environment is often very similar to your production environment. I think the primary difference is PHP is web first: it was designed to be a language for the web above all. Everything else is tacked on. On the other hand, Python is useful for a whole array of problems and a website is just one problem you can solve with it.
- prostoalex 13y agoAbstract classes in Python are kinda bolted on http://docs.python.org/2/library/abc.html http://docs.python.org/2/library/abc.html They're native to PHP http://php.net/manual/en/language.oop5.abstract.php http://php.net/manual/en/language.oop5.abstract.php
- Daishiman 13y agoAbstract classes are unnecessary and "unpythonic", if you will; there's a lot of other preferred patterns in Python for that use case.