PHP has been getting a lot of hate lately from developers. Many developers have pointed out that the programming language that we have known and loved for years is dead. They are singing songs of doom about its future and already writing its eulogies on Stack Overflow (the ‘official’ social media for developers). Still, how valid are these claims? Do they hold water, or is it just mass hysteria? To find out the future of PHP, we have to first look into where it all began in the past.
History
The beginning of PHP was the perfect accident; it was akin to how Archimedes stepped into a bath and ‘mistakenly’ found buoyancy. PHP was initially developed by a Danish- Canadian programmer called Rasmus Lerdorf in 1994. He was trying to find a way to keep track of users that saw his online resume. Little did he know that his little project would go on to become one of the most used languages in web programming.
At this point, PHP meant Personal Home Page. After he made his source code public, it quickly started gaining popularity, and in 1998, about 1% of all domains had installed PHP. However, this was just the beginning, as Zeev Suraski and Andi Gutmans wanted to use PHP for a business but found out it lacked certain features they needed.
So, like the business people they were, they collaborated with the original creator Rasmus, and that was how PHP 3 was found. The acronym PHP then changed from ‘Personal Home Page’ to “Hypertext Preprocessor.” This was a critical turning point in PHP history because it was at this point that PHP became a serious programming language. After PHP 3 was created, phpMYAdmin came to being in 1998. It is a free software tool that is written in PHP to manage the administration of MySQL
Fast Forward a few years later, the usage of PHP had increased exponentially, especially in content management systems like Drupal and WordPress. In 2004, when Mark Zuckerberg created Facebook, PHP was used as the programming language for the site.
So now that we know the history of PHP, why then is there dislike towards it? This fact is no exaggeration, as PHP was voted the sixth most dreaded language in 2020.
It is a bit confusing because PHP is still very much used to this day. It is the most popular web programming language because, as of 2019, 75% of web pages still use it. This is certainly no small feat! One of the primary reasons is that PHP is used by WordPress. In 2019, WordPress alone powered 34% of the website and currently, it has a 43% market share of all current websites. When we do the maths, that roughly puts it at 77 million websites that use WordPress and, consequently, PHP.
Other content management systems like Drupal and Joomla also make use of this programming language, and they both account for 5% of the market share. PHP is used this much because it is relatively easy to use and learn the programming language, making it perfect for beginners who want to build websites. In fact, most people that started learning to program must have dabbled in PHP.
Also, since all these websites are still using PHP, doesn’t that mean they will still need well-grounded programmers in PHP to keep maintaining and building said websites. It is not like we can all leave 70+ million websites unattended. Knowledge and use of PHP will still be needed.
The Issues
Now that we have pointed out how much PHP is still integral for web2, why is there dislike for this programming language even though almost a hundred million web pages need it? One of the reasons is that WordPress, the biggest employer of PHP, is typically used by people who have low to zero knowledge about coding to create websites. That is to say that many people who use PHP a lot do not even know that they are using PHP. Thus, the outrage against PHP comes mostly from people who actually code from scratch.
People who complain about PHP mostly talk about how convoluted the language can get. PHP makes it possible to get to a particular point from different directions. While this may be an advantage, it also makes writing bad code with bugs easier. Okay, this is not to say that you cannot write bad code in other languages, just that it is way easier in PHP.
PHP has been here for decades and, as such, has a lot of outdated structures, and if you use it like that, you will end up having a less than optimal code. When our main man, Rasmus Lerdorf, was creating PHP, he did not know how it would end up being used. So, he certainly did not prepare the code for this future.
As a developer, you could spend hours finding out what is wrong with a PHP code and find out it is something as simple as a typo in the original code. Luckily, there is a hack for this (pun intended) for anyone who wants to code with PHP. Many developers do not write the raw code; they typically use a framework to smoothen out the coding. A known PHP framework that smooths things out very well is Laravel. This framework contains pre-written codes that offer application-specific software. Here, the framework does a lot of the ‘dirty work,’ making you write better codes.
PHP 8
The most recent version of PHP – PHP 8, was launched in November 2020, with its first minor release, PHP 8.1, in November 2021. PHP 7 was a significant improvement from the past version and offered better error handling, upgraded speed, and memory. It also handled higher visits in web pages better as websites began to load faster. The PHP 8 steps up from this with higher speed, error handling, and JIT.
This JIT (just-in-time) compilation executes computer code during the execution rather than before, thus making PHP-based websites run smoother and more efficiently. This feature is similar to Facebook’s HHVM (HipHop Virtual Machine). Other features include union types, custom property promotion, null safe operator, and named arguments.
One of the most significant features here is the presence of an asynchronous design. With this, developers would be able to build asynchronous applications for websites. Okay, let’s break it down a little. In traditional websites, when you click on something or perform an action on the site, the entire webpage loads, and everything on the web page stops- this is called synchronous communication. Now, for asynchronous communication, the whole website does not stop and reload when you perform an action on the web page. Instead, only what you clicked on loads. Here, several connections are formed between the client and the server simultaneously. An example of this is email.
Prediction for the Future of PHP
There is a lot of talk about the future of PHP. Currently, the climate in the developers’ community is not favorable towards it. Whether it is a valid distaste or simply people following the trend does not matter. The truth remains that the future of PHP is still very much far from over. PHP jobs are still very much in demand as most websites use this programming language, just as we stated earlier. There is still a need for people to maintain and develop these PHP-based websites.
If this post had been before PHP 8 was released, this prediction would have been easier to make. But with the current features available for PHP 8, like the asynchronous design, the future of PHP is looking less bleak and more promising. Whether you hate PHP or not will not take away the fact that it is still integral to our webspace.
However, they are other alternatives like Python and Go, which do not share the weakness of PHP. As a matter of fact, Python is currently used a lot more than PHP in server-side development. It is also gaining a lot of popularity among beginners as well as experts, and apps like Instagram, Uber, and Spotify use it. On the other hand, Go is a programming language developed by Google and is hailed as the simplest programming language. Go is also going in the cloud development direction, which is something gaining more traction recently.
Summary
As we can see, PHP has much competition coming for it, but the fact remains that PHP is still being used a lot. So, the future is not bleak for this programming language. In the coming years, newer websites will opt for other programming languages, possibly reducing their market share. Still, it does not imply it is losing relevance anytime soon, especially with PHP 8 out. PHP has been there for us for a very long time, and we hope it remains that way.
Related Posts