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 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 of 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 make 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
Backend Frameworks with the most stars on GitHub:— Marko ⚡ Denic (@denicmarko) September 26, 2020
1. Laravel - 61.6K⭐️
2. Django - 52.1K⭐️
3. Flask - 52.1K⭐️
4. Spring Boot - 50.8K⭐️
5. Express - 50.2K⭐️
6. Ruby on Rails - 46.5K⭐️
7. Meteor - 42K⭐️
8. Nest - 30.5K⭐️
9. Koa - 30K⭐️
Which one is your favorite?
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 set up, 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 have 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!