PHP is "dying" for ten years

This article is reproduced from InfoQ. Almost a year ago, I published an article entitled "PHP may disappear in the next ten years". The summary of this article I posted is like a "Christmas Carol", but not Ebenezer Scrooge (a businessman character in the movie "A Christmas Carol"), but PHP:

  • In the past, PHP did not fix its problems, so other languages ​​became more attractive.

  • Now, PHP lacks the features required by the current Internet.

  • In the future, PHP will still not have meaningful features.

Please note that I have never written "dying", "don't use it", or even "abandon your PHP project now!". I just said that it will no longer make sense at any time before 2030, and I have made a simple interpretation of why it happened.

Considering the huge user base of PHP, articles that point out the shortcomings of PHP tend to detonate some enthusiasts. They think PHP is perfect, just because it is convenient, or because they have spent more than 10 years using PHP. My article is no exception. No matter what, I decided to pull it out of the negative cloud and give it more thought.

1This is not my problem, but yours

First of all, I have no personal grievances with PHP or any language. I think it is a very mature tool. When I need something "yesterday", it is also my favorite thing to use because it is very convenient as an interpreted language and the ecosystem is there.

This also has nothing to do with code quality. You can't blame the developer for not using a language "correctly", at least not all. No matter how cool your Ford or Lamborghini is: if you don't care about it, maintenance will be painful.

It also has nothing to do with how many people in the world use PHP. If we choose "highest user base", then we will start migrating the code to Javascript now. They won the game easily, unmatched.

Let's not say "whether it is used by important companies"-I'll talk about it later. JavaScript is already critical to SpaceX's mission, so obviously it is not a bad language, otherwise the lives of astronauts are at risk.

Only now, PHP has become a pony that can only play a trick. The language is known for its booming web development, but officials are reluctant to take further steps. Other languages ​​have been further improved. That is the mystery of death.

2 Will languages ​​"die"?

Let us take COBOL, one of the ancient programming languages, as an example.

Decades ago, some old financial systems behind banks and insurance companies were programmed in COBOL. Many financial institutions around the world still use COBOL in their mainframes. One main reason is that it still works. The proof of this is that due to the outbreak of the epidemic, the number of COBOL employees has suddenly increased to maintain these ancient systems that are constantly under impact from all over the world.

COBOL is not dead, but what does it mean? There are tools that can make COBOL-based software compatible with the needs of people today, such as web pages, even if it means fixing the rocket to the brick with a simple tool. There are still people who need to write and maintain COBOL. There are even some companies that provide some kind of support for COBOL-based systems.

We can safely conclude that programming languages ​​cannot be eliminated. There is always a bastard who uses it to make money, and another bastard who provides third-party support to make more money. This is a win-win situation.

In corporate culture, if your technology stack doesn’t cost the company any money, it’s okay. Otherwise, you will be like Amazon abandoning Oracle because of their own AWS database.

3 If it is not dead, how can it "fade out"?

COBOL is not dead, it just "fade out": no right-minded person will start a new project with COBOL because there are better tools. These tools have higher performance, better reliability, easier programming or useful features. In the COBOL era, there are no other useful technologies used in today's software, such as HTTP protocol, multithreading, and virtualization.

When people no longer use a language in new projects, dominoes begin to collapse. Tools for this language are no longer born and maintained. Because there is no demand, the language no longer introduces new features, the community no longer creates new toolsets, and it no longer spreads to other ecosystems-for example, Node.js appears on the server side. No new programmers learn this language, and programmers who have already learned this language migrate to "greener pastures."

This also means that companies are not willing to invest in the language itself, including hiring programmers. Compared with richer languages, it becomes more difficult to find developers for this language, so the salary for developers of this language needs to be higher. At this time, migrating to a new platform with lower labor costs has become an option for the company.

COBOL's situation is the same as Visual Basic, ASP.Net, Pascal, Fortran, ActionScript, Objective C, Haskell, Ruby and many other server-side languages. They have completed their technology cycle, and better languages ​​have replaced them with more features and toolsets, or less annoyance, just like PHP did for the Internet in the mid-2000s. Once Rust becomes the standard for Linux kernel development, it is also likely to happen in C and C++.

Compared with other alternative languages, the rise of PHP is mainly related to the first appearance of Wordpress and the ease of sale of PHP in the server field. Especially those languages ​​that need to be compiled into binary, even if these alternative languages ​​have more features or better performance, and PHP used to lack both. It is precisely because of the rise of Wordpress that media giants feared that their work would be killed by "a guy with a blog", so they accepted this trend and began to use Wordpress to enhance their Internet influence. Wordpress even provides VIP mode for these companies.

This "hard lock" on PHP is now changing, mainly due to cloud services providing a new platform for other programming languages, but even today, it is not uncommon to rent a server running PHP and start using it within a day . The fact is that it is easy to rent a server running Node.JS or AWS Lambda today. You don’t need years of training to use a cloud service provider, or a server service, even Google provides a tutorial on using Google Cloud Platform.

Nevertheless, PHP is still one of the few languages ​​that can support website development. As more and more people participate, the community and officials have introduced tools: Opcache for I/O performance penalty, PDO for general database layer, Autoloader for making large projects easier to manage, Composer for dependency deployment, PSR is used to standardize code specifications, PHPUnit is used for testing, PECL is used for extensions, and so on.

So, back to the concept, fading out means being replaced. Its usage will not grow, but will become stagnant. The only thing that can happen is to slowly be replaced by other solutions. This does not happen overnight, but a year-round accumulation.

From the company's point of view, changing the technology stack requires a lot of resources without immediate ROI: migrating to a new technology stack is not without cost, let alone a day. To make matters worse, some tools may not exist, such as analysis, debugging, and even deployment tools, which must be started from scratch.

This makes it difficult to persuade the boss to make a "technology stack" migration. These bosses are not the people in charge of you, but those who invest to keep profits higher than the previous period. Unless you can prove that there is a new "business opportunity", that the old technology stack is powerless, or will lose money relative to other new technology stacks, it is usually difficult to change something that has taken effect.

4 The hammer is reliable. The nail gun is better.

Combining context and looking at W3Tech's views on PHP, you will find that PHP still dominates the Internet because it is used the most, but not on 100% of the real traffic, but on top websites, including non-US platforms. In other words, if Facebook uses a PHP script, it doesn't mean that the entire platform is based on PHP—and more of it will be on the company.

Wordpress is still a widely used CMS in fact, and together with WooCommerce has become the first choice for enterprises. Although there are SaaS that provide the same service, it may not be necessary to repair things that are not damaged.

imagePercentage of server-side programming languages ​​used by websites collected by W3Techs.com

Above: PHP is still a tool to be considered for any web project. So far, Wordpress is the pinnacle of PHP. There are still new websites being created using PHP. When PHP meets all the checkboxes, it is still perfectly normal for one or two people to establish an Internet company...until it fails to meet all the conditions.

There are many web technologies available today: WebRTC, WebSockets, QUIC, HTTP/3, WebAssembly, WebAuthn, progressive web applications, machine learning, JSON Web authentication, gRPC, server-side events, etc. These technologies support online chat systems, multimedia streaming, continuous real-time data, new authentication mechanisms, and more. These technologies are difficult or even impossible for PHP to support; for example, it is difficult to support streaming large files without blocking itself, or it is impossible to support WebSockets.

Hack is just the future of big companies, because they can burn money to run HHVM from the start...

Because there is a lot of work to do, it has become a norm to transition from one language to multiple languages, or to push services to companies that provide you with the functions you need, such as letting Mux handle the video platform and Pusher handling event propagation. . Some people may say that you are spending money for convenience, but others will say that you pay because your technology stack cannot handle these issues.

On the other hand, you can control everything yourself. The front end can work under PHP, or it can be a single page application (Single Page Application, SPA) based on JavaScript or a framework like React, Angular or Vue. The backend can run on applications based on Rust, Go, F#, HHVM, .Net Core, Node.js or any other language. Because PHP can't do everything, development hell begins, and consistency will quickly lose. You start from relying on one ecosystem to relying on many ecosystems.

It is not surprising that PHP projects are combined with other SaaS or runtimes based on Node.js, Python, Go or Rust. Add another code base or application to maintain. This may do more harm than good, because you have to deal with two (or more) deployment scenarios for each part of the project.

Although there are a few people who can handle everything, the possibility of offering a contract to one person is very small, mainly because there are few people who can handle everything and it's not cheap.

5 "But this great company uses PHP"

One sentence I often hear is "but Facebook uses PHP", as if it is a booming Web technology. The top companies that started with PHP have made it clear that Hack and HHVM-"modern PHP but consume memory"-are the company's follow-up measures:

  • Facebook migrated to Hack/HHVM and started operation in 2014.

  • Wikipedia also abandoned PHP through HHVM support in 2014.

  • Etsy also migrated from PHP to Hack in 2015.

  • Slack, acquired by SalesForce for $27.7 billion, also migrated from PHP to Hack in 2020.

Note that I emphasized the "company follow-up measures." Hack is the future? In fact, Hack is just the future of big companies, because they have the money to run HHVM from the start, and they don't want to migrate 90% of their code. The remaining non-millionaire companies can only use PHP and cheap servers.

Any company with large sums of money can create its own language for its own benefit, just like Facebook, Apple, Google, and Mozilla, because they have people and brains to do it, and services to achieve it. For better or worse, we are just incidental.

Having a language with stable inherent needs can make it progress, even if sometimes it means making bad decisions.

6 it's enough until it can't

Sometimes it's a bit sad to say "you can't do that on PHP". The new JIT engine is very popular, but it is not a panacea for combining it with other emerging languages. Performance used to be a very important issue for PHP, but now it is not the only issue. The Internet is evolving, but PHP is not.

image

Image credit: Carl Heyerdahl on Unsplash

Today, the web is just the starting point. The ongoing COVID-19 pandemic shows that you need systems to respond to the changing state of different data types. Nowadays, PHP is not enough, and when it is enough—see how slow recent developments are—developers will have better tools. No one will wait for PHP to modernize itself, and no company will do so. This is what is called progress: new tools replace old tools.

The problem arises when you need more than just display a web page with basic interaction. At that time, PHP showed its more than two decades of history and how it is out of touch with today's technology and product requirements.

I am certainly not the only one who has waited long enough for PHP to become a decent technical competitor. From a business logic point of view, PHP is very convenient because its syntax allows very expressive declarative operations in the hands of experts, especially in the "business logic" part, but it is not a panacea.

PHP is now, but not the future.

I think these paragraphs show that PHP is still king because of its nature. There is no language that provides convenience and maturity at the same time that has gained such a great appeal, but not the function-in addition, it is the Wordpress effect.

How will PHP be eliminated? Everyone can create their own profile, store, picture library, cloud storage, group chat, etc. with just a few clicks; no hosting, no server and code required.

I personally think that now, due to the proliferation of SaaS and one-click installations, we have surpassed "killer apps" like Wordpress. We are now in the "killer ecosystem", a language has described the part, and you bring your own glue. Maybe Node.js? Maybe Go? Maybe Python? Maybe TypeScript is compiled to binary? Maybe it's Rust's garbage collector? Maybe a brand new language?

7 maybe PHP 9?

I see some people want to make major changes to PHP. Unless there are changes within Rogue Wave (Perforce) to push the Zend engine forward technically, it will definitely not. They probably want to sell the Zend server. I don't think they are successful when you consider the trend of big companies leaving PHP as soon as possible and make the blog post mocking everyone.

It's not that PHP will stop using it tomorrow: it still works, and it's easy to master, because there is always an MVP to start, and it doesn't need fancy stuff. It's just that PHP is the present, not the future, and the people responsible for this don't really care. Maybe once a new language appears, provide the best part of PHP and other languages. Hack just proved that company-level PHP has a good code reuse market.

Once the next big event swept the Internet, PHP would not have time to catch up.

No language will die completely. PHP is not dead, it's just that other languages ​​have surpassed it. Of course, they are not battle-tested like PHP... but they are being implemented.

When you think that humans have an inherent fear of the unknown, it is easy to sympathize with the anger of language enthusiasts who were told to try another tool. This is suitable for getting out of your comfort zone and entering new things. In this case, it is a migration from a reliable language (such as PHP) to another language that better suits your needs. No one will die just by "wasting" a week or a month to learn and understand the new ecosystem. The worst-case scenario is that you learn where to go no more, just like you chose the wrong vacation destination.

Through years of software development to solve problems, I realized that moving towards (rather than running towards) the technological horizon is part of the job, even if it means accepting what we once loved and moving towards destiny...

Guess you like

Origin blog.csdn.net/weixin_39787242/article/details/115124114