Hướng dẫn does php have a future? - php có tương lai không?

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

Phiên bản gần đây nhất của PHP - Php 8, đã được ra mắt vào tháng 11 năm 2020, với bản phát hành nhỏ đầu tiên, Php 8.1, vào tháng 11 năm 2021. Php 7 là một cải tiến đáng kể từ phiên bản trước đây và cung cấp xử lý lỗi tốt hơn, nâng cấp tốc độ và bộ nhớ . Nó cũng xử lý các lượt truy cập cao hơn trong các trang web tốt hơn khi các trang web bắt đầu tải nhanh hơn. Php 8 bước lên từ điều này với tốc độ cao hơn, xử lý lỗi và JIT.

Việc biên dịch JIT (đúng lúc) này thực hiện mã máy tính trong quá trình thực thi chứ không phải trước, do đó làm cho các trang web dựa trên PHP chạy mượt mà và hiệu quả hơn. Tính năng này tương tự như Facebook HH HHVM (Máy ảo HiPHop). Các tính năng khác bao gồm các loại công đoàn, quảng bá tài sản tùy chỉnh, toán tử an toàn null và các đối số được đặt tên.

Một trong những tính năng quan trọng nhất ở đây là sự hiện diện của một thiết kế không đồng bộ. Với điều này, các nhà phát triển sẽ có thể xây dựng các ứng dụng không đồng bộ cho các trang web. Được rồi, hãy để Lừa phá vỡ nó một chút. Trong các trang web truyền thống, khi bạn nhấp vào một cái gì đó hoặc thực hiện một hành động trên trang web, toàn bộ trang web tải và mọi thứ trên trang web dừng lại- điều này được gọi là giao tiếp đồng bộ. Bây giờ, đối với giao tiếp không đồng bộ, toàn bộ trang web không dừng lại và tải lại khi bạn thực hiện một hành động trên trang web. Thay vào đó, chỉ những gì bạn đã nhấp vào tải. Ở đây, một số kết nối được hình thành giữa máy khách và máy chủ cùng một lúc. Một ví dụ về điều này là email.

Dự đoán cho tương lai của PHP

Có rất nhiều cuộc nói chuyện về tương lai của PHP. Hiện tại, khí hậu trong cộng đồng nhà phát triển không thuận lợi cho nó. Cho dù đó là một sự chán ghét hợp lệ hay đơn giản là những người theo xu hướng không quan trọng. Sự thật vẫn là tương lai của PHP vẫn còn rất xa. Các công việc PHP vẫn còn rất nhiều nhu cầu vì hầu hết các trang web sử dụng ngôn ngữ lập trình này, giống như chúng tôi đã nêu trước đó. Vẫn cần mọi người duy trì và phát triển các trang web dựa trên PHP này.

Nếu bài đăng này đã có trước khi Php 8 được phát hành, dự đoán này sẽ dễ thực hiện hơn. Nhưng với các tính năng hiện tại có sẵn cho PHP 8, như thiết kế không đồng bộ, tương lai của PHP trông ít ảm đạm và hứa hẹn hơn. Cho dù bạn có ghét PHP hay không sẽ không lấy đi thực tế rằng nó vẫn không thể thiếu đối với không gian web của chúng tôi.

Tuy nhiên, chúng là những lựa chọn thay thế khác như Python và Go, không chia sẻ điểm yếu của PHP. Như một vấn đề thực tế, Python hiện được sử dụng nhiều hơn so với PHP trong phát triển phía máy chủ. Nó cũng đang đạt được rất nhiều sự phổ biến trong số những người mới bắt đầu cũng như các chuyên gia và các ứng dụng như Instagram, Uber và Spotify sử dụng nó. Mặt khác, Go là ngôn ngữ lập trình được phát triển bởi Google và được ca ngợi là ngôn ngữ lập trình đơn giản nhất. Go cũng đang đi theo hướng phát triển đám mây, đó là một điều gì đó đạt được lực kéo gần đây.

Bản tóm tắt

Như chúng ta có thể thấy, PHP có nhiều sự cạnh tranh đến với nó, nhưng thực tế vẫn là PHP vẫn đang được sử dụng rất nhiều. Vì vậy, tương lai không ảm đạm cho ngôn ngữ lập trình này. Trong những năm tới, các trang web mới hơn sẽ lựa chọn các ngôn ngữ lập trình khác, có thể giảm thị phần của họ. Tuy nhiên, nó không ngụ ý rằng nó sẽ mất liên quan bất cứ lúc nào sớm, đặc biệt là với Php 8 ra. PHP đã ở đó cho chúng tôi trong một thời gian rất dài, và chúng tôi hy vọng nó vẫn như vậy.

Bài viết liên quan

Hướng dẫn does php have a future? - php có tương lai không?

Hướng dẫn does php have a future? - php có tương lai không?

PHP vẫn có liên quan vào năm 2022?

Điều này là khả thi ngay cả trong năm 2022 vì PHP là linh hoạt trên các hệ điều hành. Ví dụ: bạn có thể chạy nó trên các Windows và các biến thể hiện đại của nó hoặc sử dụng nó trên OSX hoặc Linux. Nếu mọi ứng dụng web hoặc trang web bắt đầu sử dụng một ngôn ngữ khác nhau cho các nỗ lực hiện đại hóa của mình, chi phí phát triển sẽ tăng vọt.viable even in 2022 because PHP is versatile across operating systems. For example, you can run it across Windows and its modern variants or use it on OSX or Linux. If every web application or website starts using a different language for its modernization efforts, development costs will skyrocket.

PHP có tương lai tốt không?

Như chúng ta có thể thấy, PHP có nhiều sự cạnh tranh đến với nó, nhưng thực tế vẫn là PHP vẫn đang được sử dụng rất nhiều.Vì vậy, tương lai không ảm đạm cho ngôn ngữ lập trình này.Trong những năm tới, các trang web mới hơn sẽ lựa chọn các ngôn ngữ lập trình khác, có thể giảm thị phần của họ.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.

Là bất kỳ tương lai cho các nhà phát triển PHP?

Chủ yếu, phạm vi tương lai của PHP nằm trong phát triển web.Họ chịu trách nhiệm thiết kế, tạo và duy trì các trang web và ứng dụng cho Internet.PHP với cơ sở dữ liệu có thể tạo các trang web và ứng dụng tương tác và động.PHP's future scope resides in web development. They are responsible for designing, creating, and maintaining the websites and applications for the Internet. PHP with a database can create interactive and dynamic websites and applications.

Có đáng để học PHP vào năm 2022 không?

Tuy nhiên, cơ hội việc làm chắc chắn là ngoài kia, đối với những nhà phát triển để mắt đến việc phát triển các nền tảng cho các công ty khởi nghiệp có lẽ họ không phải là loại cơ hội khiến bạn phấn khích - và đó chắc chắn là điều cần xem xét.Đối với cá nhân tôi, chắc chắn có một nơi để học PHP vào năm 2022.there is definitely a place to learn PHP in 2022.