3 ms·
There are many languages that are as simple or even simpler than PHP in syntax, and if you're comparing it to JavaScript, nodejs is literally JavaScript. PHP's
by milankragujevic 7y ago
There are many languages that are as simple or even simpler than PHP in syntax, and if you're comparing it to JavaScript, nodejs is literally JavaScript.
PHP's biggest strength is ease of deployment and popularity. Deploying a nodejs app is a nightmare, because of the fact that nodejs isn't a web-first language in the traditional sense. It's a general purpose language that can do many things, but that causes problems for, i.e. hosting multiple apps on a single server (without having to coordinate ports between them, firewall them off, and have a single nginx instance proxying to them based on domain names).
PHP is simple to deploy. If you have a shared hosting, just upload files to the FTP server, and open the page in the browser. It works. If you have a root server, just `sudo apt install -y apache2 libapache2-mod-php7.3` and put the files in /var/www/html/
It's a perfect fit for web because that's the only place where it actually works. It does one thing (platform) and it does it well (from the deployment perspective).
It has (had) it's warts in the years, but I don't find many things that it doesn't have compared to other scripting languages.
- flir 7y agoThink you're underestimating the array functions. They might be ugly (programmers tend to prefer expressive array syntax), but their learning curve is the best of any language. So much of programming for the web is "do something to an array of stuff", and PHP makes that super-easy.
- wolco 7y agoThe built in standard libruary has everything you need. No packages are really required.