5 ms·
Are the complaints about PHP even controversial? The built in library functions are a mess, and mostly terrible. The syntax and basic language are overly verbos
by Almaviva 13y ago
Are the complaints about PHP even controversial? The built in library functions are a mess, and mostly terrible. The syntax and basic language are overly verbose and have layers upon layers of cruft. The type and object systems are grafted on, and have so many gotchas and inconsistencies that it takes many months to understand enough of them to be very productive in the language. The aspects of PHP that were intended to make it simple (like pretending types don't exist) actually make it more difficult to reason about precisely. I don't think anyone who knows anything else would ever choose PHP for a fun personal project.
Despite this, there is nothing in PHP that prevents you from doing the thing you want to do, however you want to do it. As projects become larger and involve more time and people, the fine grain of line syntax fades out of view, and all that is left is the large scale design decisions, which are similar in any language. And this is what ultimately determines the technical success or failure of software.
- Tloewald 13y agoI think it's exceptionally easy to become productive in PHP quickly and to reason about the code despite all the warts and gotchas. The good points about PHP raised in the slides (statelessness, etc.) hugely simplify thinking about code, offsetting the bad stuff and then some. Doesn't make me want to give up python or node, but these are strong points in PHP's favor.
- maratd 13y ago> I don't think anyone who knows anything else would ever choose PHP for a fun personal project. I would. For every job, a proper tool. If my project is client-side heavy and only needs a thin layer between the client-side and the database, I'll pick PHP. The code I would write in PHP would be minimal and I would get it up and running very quickly. If I'm writing something substantial on the server-side, then yeah, you may want to consider something else.
- wslh 13y agoBut with so much frameworks around it is a relief to have the complete control and library support. I am talking about plain PHP.
- asnyder 13y agoI 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]
- 13y ago