Why I continue to develop with PHP

Subscribe to my newsletter and never miss my upcoming articles

I have no doubt that if you work in any realm of software engineering, or have at the very least spent enough time on Twitter, you'll have encountered the seemingly endless cycles of arguments about what programming language, framework, or paradigm is best, and why everyone else is wrong.

PHP is no stranger to being a point of contention among different factions of web developers, and is sometimes depicted as an ancient, labouring technology. In reality, this is so far from the truth that it's astonishing.

Why do people dislike it?

Some people can't even give you an answer! It's just fun to make fun about it. Though many do have genuine and understandable answers. A great deal of PHP code is written terribly, without conforming to the accepted standards that makes working with the language, especially in corporate environments, significantly easier. Even common frameworks like CodeIgniter and the ubiquitous WordPress are guilty of this, hence the derision. Other codebases don't make use of modern PHP functionality and suffer as a result.

A lot of other ridicule comes from lack of consistency in older function naming conventions and quirks of the language itself, but I really feel that this is grasping at straws at most, and such criticisms could be directed at other languages like JavaScript too, that aren't flawless.

Node.js isn't king, yet

Node.js, the JavaScript runtime powering many web applications is an insanely powerful tool with great frameworks to boot. It's incredibly popular and is sometimes credited with being the future of all web development - JavaScript across the entire stack.

This of course, doesn't mean that PHP (and indeed other languages) are being forced out. Languages like PHP (and Python, Ruby, etc.) have diverse and mature ecosystems that power everything from simple blogs to large ecommerce monoliths. Let's look at the statistics:

PYPL Index

The PYPL index indicates that JavaScript sits at #3, and PHP shortly trails at #4, from this time of writing.

TIOBE Index

According to the TIOBE index, PHP continues to rise, sitting at around tenth place at the time of this writing.

Bare in mind, this includes usage of JavaScript across the entire stack, including front-end, where it remains an integral building block of the web.

The rise of Laravel... and WordPress

The Laravel web framework, despite being relatively new, has skyrocketed its way to stardom on GitHub. This naturally isn't representative of its usage, but its MVC, Rails-like architecture, command-line interface Artisan, database interactivity via object-relational mapping, templating engine, and testing suite for robust Test-Driven Development all out of the box, it's a Swiss army knife that makes development not just easy, but immensely fast. I routinely make use of this framework, so I'm biased, but I highly recommend it.

WordPress usage statistics

For better, or for worse, WordPress continues to climb in usage. It's easy to setup, its assortment of plugins and themes are unparalleled across all content management systems (CMS), and to its credit, has been working hard to rectify many of its historical security problems. The rise of JAMstack and static site generators has arguably made WordPress even more popular - by utilising it as an easy-to-use headless CMS that exposes its API to hydrate rapidly loading front-ends. Of course, if you're looking to make money, then coding your own plugins and themes will remain profitable.

Okay I'm convinced! What now?

PHP is a fun and useful programming language to have in your arsenal, but don't take my advice for it, go and explore the elephant ecosystem for yourself! I strongly recommend the following learning resources for getting on your way:

  • Codecademy is ideal for absolute beginners who want to learn language syntax without needing to install the language.
  • PHP The Right Way is something you should keep on-hand at all stages of your career - it will remind you of the best ways to do things and common pitfalls to avoid. It will also guide you on how to install the language and package manager, Composer, on your operating system.
  • Laracasts is an incredible learning resource for both PHP and Laravel, with plenty of free learning paths for you to sample. I highly recommend a paid subscription if you're serious about PHP. Great for Vue.js too.
  • Codecourse is another strong contender with plenty of free resources on PHP, Laravel, and other popular microframeworks.
  • PHP.net and of course, the language's actual documentation.

Final thoughts

Ultimately, my tl;dr answer for why I develop using PHP in 2020 is because I like it. I grew up with it - and it remains and continues to mature as a respected and powerful tool on the Internet. This article's purpose isn't to discredit other languages, like Node.js, but to reaffirm PHP's place among them, and to serve as a reminder that it isn't going anywhere anytime soon, regardless of how many paamayim nekudotayim jokes you make!

I hope that you enjoyed my article, written as part of Hashnode's technical writing bootcamp. As always, I'd love to hear your thoughts and opinions, so please leave them below! Until next time!

Lucas Terracino's photo

PHP has been bashed A LOT for things that were addressed years ago. Getting close to a PHP 8 release, the critiques usually come in the form of PHP 5 feedback.

Oliver Earl's photo

Definitely. It hasn't helped that WordPress (and a few other FOSS projects that I can think of) insisted on supporting deprecated versions of PHP, as far back as 5.3 at one point if I recall correctly, so you just ended up with horrendous, inefficient, and antiquated code.

As you say though, with PHP 5.6 mothballed and 8 just around the corner, things have improved massively.

Lucas Terracino's photo

Absolutely, also a new wave of developers educated in the ways of PHP through OOP thanks to Laravel being the awesome framework I think it's helping reshape the culture of what PHP actually is right now.

Kathryn Brown's photo

Back way too long ago to comfortably admit, I developed Wordpress sites for clients, using PHP 4 and 5. Now I program in JavaScript and python mostly, and it's been years since looking at PHP. But after reading your article, I think I'll give another look at its updated features and at Laravel. Thanks for the tip!