🌱 Seedling thought

29 of 365, PHP isn’t that bad

planted on in: 365 day writing project, 365DayProject and PHP.
~527 words, about a 3 min read.

This is day twenty-nine of my attempt to write something, anything, every day for 365 days in a row; currently 7.95% complete with a seven-day streak.

PHP has been my primary programming language out of choice for close to two decades; even saying that makes me feel old; prior to that, for a few years I tinkered with Visual Basic, Quick Basic and BASIC but that was as a teen. My entire professional career has been programming primarily in #PHP.

I knew Visual Basic to an intermediate level by the time I wanted to start building a multiplayer game, at the time .NET was the obvious choice given its relationship to VB and I began to build out an application only to quickly find that hosting it would cost me an arm and a leg! Remember at this time I was around 15 or 16 and therefore without income; I quickly discovered free hosting for something called PHP with something called MySQL and free is a good motivator!

It seems this was a good motivator for a lot of people (although more likely because PHP was cheaper to host, rather than free in a commercial setting,) looking at W3Techs usage statistics for server-side languages in use as of August 2023 a whopping 77.4% of all the websites whose server-side programming language can be identified use PHP!

The PHP language gets a lot of flak, so much so that it has become a meme in-of-itself; not all of it is deserved, in actual fact PHP isn't that bad and a lot of the complaints that have become memes really target early versions of the language from a time when it was terrible (think version four.)

Yes, there are inconsistencies, the ease of using the language lead to some insecure practices by those who did not know better, it has in the past been incomplete (think OOP), until xDebug came on the scene debugging was a mess and having a low barrier to entry enabled the inexperienced to follow bad practices.

However, I will argue that a lot of the complaints are about 90s PHP and that the language has progressed so far from those roots that scoffing at the idea of using the language comes off as intellectually delinquent.

Version 7 of PHP brought about some great changes to the language, not-least huge performance gains over version 5; with version 8 bringing to the table some features I have enjoyed in other languages such as Go and TypeScript. I now find it hard to use other languages in a server side context because PHP is both comfortable and feature-complete for my needs.

With Composer, Symfony and Laravel PHP has become an excellent choice for server side applications. Quite frequently when I work on a Node or Go project I find myself having to write functionality that already exists in Laravel, it's got to the point where a lot of other languages feel lacking.

PHP had its awkward teen phase and people need to stop using that to punch down on the language, it has matured and that should be celebrated.


Page History

This page was first added to the repository on August 10, 2023 in commit fa3ebe81 and has since been amended once. View the source on GitHub.

  1. refactor(#304): move files into src folder
  2. publish: 29 of 365, PHP isn’t that bad