8 ms·
PHP’s popularity is not only due to Wordpress. The language is simple and accessible. The ecosystem and community are ginormous. Are you stuck on something? A
by jedisct1 5y ago
PHP’s popularity is not only due to Wordpress.
The language is simple and accessible.
The ecosystem and community are ginormous. Are you stuck on something? A quick Google search has the answer. Finding PHP developers anywhere is also easy.
It’s fast. No, really. And keeps getting faster.
It’s easy to run directly on your local dev environment.
It’s boring in a good way. Evolution is incremental. Breaking changes happen, but nothing unmanageable, and every version is supported for a long time.
There’s not a ton of confusing options to choose from, with the risk that they will eventually become obsolete/un maintained. Laravel and Symfony are pretty damn good.
Need to get something done quickly, just for a prototype? PHP ‘s a good choice. You will get there quickly, even if the code is not something you’ll want to show off with.
Need to choose a language for a web application that need to be maintained long-term? PHP is not a bad choice either, for all the reasons mentioned above.
- jpgvm 5y agoEverything you say is also true for Java or Kotlin, which are better languages and have even better backwards compatibility story. You also left out all the downsides of PHP so it looks more flattering than it should. So while PHP is ok, why choose PHP when you can choose Java/Kotlin? The only benefit of PHP over Java/JVM-langs is probably memory usage, which is generally not that important of a factor in today's environment where memory is cheap and devs are expensive. I think unless you are already super familiar with PHP it's probably not the ideal choice. You could do worse, but you can also do better with Java/Kotlin/C# all of which have the good parts of PHP but none of it's bad parts, higher quality ecosystem, higher quality devs, better tools, faster runtime, etc.
- dncornholio 5y agoBetter is highly subjective, especially in this case. Also, why would you distinguish Java/Kotlin/C# as something different then PHP? Java/Kotlin/C#/PHP they all mean the same to me. They're programming languages..
- jpgvm 5y agoStatic compilation, real type system, real runtime, static analysis, higher quality IDEs (IDEA, VS), higher quality libraries (Spring and ASP.NET). They are in a completely different class to PHP. That is like saying a Honda Civic is the same as an Ferrari F1 car.
- Zababa 5y ago> That is like saying a Honda Civic is the same as an Ferrari F1 car. In that nobody uses a Ferrari F1 car to do anything practical?
- jpgvm 5y agoI could have chose a better comparison but you really are completely misconstruing the point just to be edgy, i.e haha very funny but no. Your bank is probably running 90% Java. Every large website you use may not be written in Java but relies on mission critical systems that are etc. It's an insanely practical language, in fact probably -the- most practical language and that is why it's chosen overwhelmingly for important systems that need a large number of developers.
- dncornholio 5y agoNobody's saying banks should use PHP as their backend though.
- sbarre 5y ago> Everything you say is also true for Java or Kotlin Uhh no. Getting a local dev environment set up for PHP is much much easier. Writing your first line of code and seeing things run in a browser is much much easier. Uploading a single standalone PHP file you wrote to your 5$ webhost via SFTP, with _no other work required_ and just seeing your code run on your website? Show me how to do that exact thing in almost any other web programming language. You can't. No one said PHP was perfect, and I'm not here to defend all the problems, but to compare PHP's almost universal accessibility and ease of use (which is why it is so popular) to something like Java or C# is ridiculous.
- throwaway894345 5y agoThis feels a lot like comparing languages based on “hello, world” programs. > Uploading a single standalone PHP file you wrote to your 5$ webhost via SFTP, with _no other work required_ and just seeing your code run on your website? Show me how to do that exact thing in almost any other web programming language. You can't. You can do this with Go and you don’t even need your webhost to have any special language support. Moreover, that single file can be an entire program, not just a single source file.
- jpgvm 5y agoIf anyone thinks local dev with Java/Kotlin is hard they haven't tried it in the last decade. The years of WARs and application servers are long since gone, every framework you would interact with (Spring etc) are self-hosting, i.e even easier than PHP because you don't need a web server, you don't need to know what FastCGI is, etc. If you pay for a host that has all this setup and SCP/FTP your files to it sure, but is that -really- easier than the local dev experience vs the Sprint Boot starter pack? I don't think so.
- blueflow 5y agoPHP has this "upload a file via ftp and run it via the browser" thing. If you are already familiar with HTML, the upgrade to PHP is an easy step.
- Zababa 5y agoThere's something I don't like when people talk about PHP, and that's putting Symfony/Laravel and XAMP/shared hosting PHP into the same bucket. I feel like it's a dishonest way to present PHP as something it's not. Symfony/Laravel PHP is basically like any other language, you could use Ruby with Rails, Python with Django, Java with Spring, Elixir with Phoenix and it's basically the same ballpark. But you give up the simplicity of setup and deployment. XAMP PHP, on the other hand, is probably one of the most accessible way to do web programming, but isn't the same at all as Django, Rails or even Symfony/Laravel. You use the same language, sure, but the two are very different beasts. You could probably add a third with the world of PHP-based CMS, like wordpress or drupal.
- azangru 5y ago> Symfony/Laravel PHP is basically like any other language ... But you give up the simplicity of setup and deployment. > XAMP PHP, on the other hand, is probably one of the most accessible way to do web programming, but isn't the same at all as Django, Rails or even Symfony/Laravel. I'm confused by this assessment. As far as I understand, it is not unusual for hosting providers to offer shared hosting that supports php, but not other popular server-side languages, and makes it possible to run Symfony or Laravel, but not Django, Rails, Spring, or Phoenix.
- Zababa 5y agoMy point is that if you're using Symfony/Laravel and composer, the difference between shared hosting or anything else that would run your python/ruby/java/elixir code is relatively small.