Why I continue to develop with PHP
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.
Node.js isn't king, yet
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:
According to the TIOBE index, PHP continues to rise, sitting at around tenth place at the time of this writing.
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.
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.
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!
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.
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.
Leadership Coach and Product Manager. Tech nerd, plant lover, lifelong learner. I help people and teams achieve greatness!