4 ms·
PHP is pretty objectively bad. For every thing PHP does decently well, something else does it better. Except for this one weird trick: PHP absolutely bulls-eye
by mseebach 10y ago
PHP is pretty objectively bad. For every thing PHP does decently well, something else does it better.
Except for this one weird trick: PHP absolutely bulls-eye nothing-but-net nailed deployability before deployability was even a word. In 2000, you could download an installer that set up Apache, MySQL and PHP on your Windows box (and it worked, first time and every time), you could fire up Notepad and 15 seconds later look at "Hello World" in your browser. Then you could upload that PHP file to a web hotel at $10/month and the world could see that same Hello World perhaps 10 minutes after that.
Heroku + Ruby on Rails gets close[1], but it took them nearly 10 years to catch up.
That's why PHP is so popular.
1: in zero-to-one deployability for a new user -- the full development and deployability experience just a tiny bit up the learning curve is orders of magnitude better.
- spoiler 10y agoFWWIW Ruby is my favourite language, but it's nowhere near being as beginner-friendly for web development as PHP. This is mostly because PHP was designed as an "embedded" language from the grounds up, and by the fact it's so widely supported by hosting providers. Most hosting providers have no support for Rails (or general rack-based applications); most that do, offer patchy support, though. Furthermore, I remember a few years back, Ruby was a hassle to set up, especially on Windows.
- codedokode 10y agoThere are more popular and worse languages, for example Javascript: - no classes (so people end up emulating them: Backbone has methods to emulate class declaration and class inheritance) - no type hinting. You cannot specify function argument type or return type. It makes code harder to read and to maintain. - too forgiving. You can divide by zero or mistype a property name and get no error. You can add arrays to strings. It makes bugs harder to find. - no coding standard. Everyone uses whatever style they like - no single modules standard - no syntax for asynchronous operations - difficult to install XML library on Windows (you need to setup a Visual Studio to compile binary modules) > Heroku + Ruby on Rails gets close[1], but it took them nearly 10 years to catch up. You have to learn Linux and command line to use Ruby. No wonder it is more difficult for a newbie. Deploying and running an application is more complicated in Ruby. Also with long-living applications it is easy to get a memory leak. But recently PHP started to depend more on CLI tools too (installing and using composer might be not easy for people who got used to GUI and don't understand concepts like "working directory").