What is the future path for PHP programmers in 2017?

 Watson Blog December 2, 2017 13:18:23 Watson News comment one hundred and sixty-one Reading mode

PHP has a history of more than 20 years since its birth. From the rise of the Web era to the ebb of the mobile Internet, various programming languages and technologies in the Internet field emerge in endlessly. Node.js, GO, Python are constantly challenging PHP's position. The promoters of these technologies are very keen to sing bad about PHP. Where is the future of PHP? How should PHP programmers cope with future changes?

As an old web back-end programming language, PHP has a very high market share in the world, second only to Java. From the data of various recruitment websites, there are many positions for PHP development, and the salary level is also very good. In fact, PHP has a higher market position than Java in SMEs and Internet start-ups. Java has greater advantages in super large enterprises, traditional software industry and financial field. At present, Node.js, GO, Python, Ruby and other languages are hard to match PHP and Java.

The reason why PHP has today's status is that PHP language designers have always followed pragmatism, hiding the complexity of technology at the bottom. PHP language is easy to learn, easy to master, and has good program robustness. It is not easy to have complex problems like Java, C++and other languages, such as memory leakage and crash. Tracking and debugging is relatively easy. The official standard library of PHP is very powerful, and all kinds of function functions can be found in the official standard library, including MySQL, Memcache, Redis, GD graphic library, CURL, XML, JSON, etc., which avoids the trouble of developers looking for libraries everywhere. The PHP documentation is excellent. Each function has a detailed description and use examples. Third party class libraries and tools, code, and projects are also very rich. Developers can use PHP to write and develop all kinds of software quickly and efficiently. So far, there is still no simpler and easier to use programming language on the market than PHP. Therefore, the prospect of PHP is still very broad. Instead of focusing on the choice of programming language, it is better to study and use PHP in depth.

As a senior PHP developer, I give you ten suggestions on the future of PHP programs in terms of technology. I hope it will be helpful to you.

1. Composer

The first point is about Composer. Since the appearance of Composer, PHP dependency management can become very simple. The program depends on some class libraries and frameworks. You can use Composer directly to import them. You can use Composer update to install dependent packages. It solves various problems of loading external libraries in the past. Composer also has domestic images, which are very fast. Most PHP open source projects now provide Composer support. It is recommended that you use Composer in projects to solve the problem of PHP code package management, instead of using the original method of downloading source code and manually including.

2. PHP7

The PHP 7 version has made a lot of changes to the Zend engine, greatly improving the performance of the PHP language. Using PHP 7 can double the performance of your program instantly. Even a heavyweight software such as WordPress can have thousands of QPS when running in PHP 7, which is equivalent to that a server can handle 80 million requests every day. Use PHP 7 to optimize MySQL, and use Memcache and Redis to accelerate. This technical architecture can fully cope with large-scale systems. Except for some platforms with hundreds of millions of users, systems of general scale have no pressure at all.

3. PSR

PSR Yes http://www.php-fig.org/ The PHP language development specification formulated by the organization stipulates many rules, such as namespace and class name

Specification, coding style standard, Autoload, public interface, etc. Now it has become the de facto standard of the PHP technology community. Many well-known PHP frameworks and class libraries comply with the PSR specification. PHP developers should learn to master the PSR specification and try to follow the PSR specification when developing programs.

4. Swoole

Is PHP still limited to Web sites in 2017? No , If you don't know Swoole, go and learn about it. The slogan of Swoole is to redefine the PHP language. Swoole is an asynchronous parallel communication engine that runs as an extension of PHP. Node.js has asynchronous callback Swoole, and Go has coroutine Swoole, which completely subverts the understanding of PHP. Using Swoole PHP, you can implement the server program resident in memory, and program and develop TCP and UDP asynchronous network communication. In the past, PHP could only be used as a Web site. Now, Swoole can be used as a communication service that can only be realized by Java and C++, such as WebSocket instant messaging, chat, push server, RPC remote call service, gateway, proxy, game server, etc. If you want to use PHP to do something outside of the Web system, Swoole is the best choice.

5. Laravel

The most popular PHP framework in recent years is known on the official website as a framework designed for Web artists, which shows how elegant this framework is. Laravel provides rich functional modules, simple API design and strong expression. Moreover, its community is very active, with many code contributors, many third-party plug-ins, and a thriving ecosystem. Many symfony2 components are used in the bottom layer of Larave, and dependency management is realized through composer. If you are still struggling with what PHP framework to use, it is better to choose Larravel. The command line tool provided by Laravel is based on symfony.console, which is powerful and integrates various project management and automatic code generation functions.

6. Phar

After PHP 5.3, Java like jar package named phar is supported. Used to package multiple PHP files into one file. This feature allows PHP to package and componentize applications as easily as Java. An application can be packaged into a Phar package and directly placed into

PHP-FPM. With Swoole, you can execute php server.phar on the command line to start the server with one click. The PHP code package can be packaged into components with Phar and put into the server container of Swoole to load and execute.

7. C/C++/GO

Any technology has its advantages and disadvantages. PHP, as a dynamic scripting language, has the advantage of convenient development and high efficiency. The disadvantage is poor performance. In the context of intensive computing, it is dozens or even hundreds of times different from C and C++. In addition, PHP cannot directly operate the underlying layer, and needs to rely on the extension library to provide API implementation. PHP programmers can learn a static compilation language as a supplement to realize dynamic static complementarity. C/C++/Go is a good choice. Moreover, the programming experience of static languages is completely different from that of dynamic languages, and the learning process can make you better.

After mastering the C/C++language, you can also read the source code of PHP, Swoole, Nginx, Redis, Linux kernel and other open source software to understand their underlying operating principles.

The latest version of Swoole now provides support for C++extension modules, encapsulates the Zend API, and makes it easy to use C++to operate PHP. You can use C++to implement PHP extension functions and classes.

8. HTML5

As a new generation standard of Web front end, HTML5 has a very broad future and a large market demand. From PC websites, B/S enterprise software, mobile web pages, APP, these fields are embracing HTML5. Only by mastering HTML5 can we survive in the next wave of Internet technology.

9. Vue.js

In addition to writing background programs, PHP programmers also work in the presentation layer and deal with the front end of the browser. In 2017, are you still using jQuery to operate DOM to achieve interface rendering? It's completely out. Now Vue.js can be used to easily bind data and DOM elements. After the data is returned from the Ajax request background interface, the front-end data is updated to automatically render the interface. It will be too late to learn Vue in 2017.

If you want to write not only Web programs, but also Android, IOS, PC client and other platforms, React Native is a good choice.

10. Deep learning/AI

The future of the Internet belongs to artificial intelligence. If you don't understand the concepts of machine learning, deep learning and artificial intelligence, you need to learn about them as soon as possible. Now Internet giants are laying out artificial intelligence, including Google, Facebook, Microsoft, Amazon and Baidu in China. Although it is still in the stage of scientific research, in the future, all fields of the Internet will be applied to artificial intelligence, including automatic driving, big data analysis, online games, image recognition, language processing, etc. Of course, ordinary engineers may not be able to participate in AI products, but at least they should understand the basic concepts and principles of deep learning/AI.

I haven't even got started yet, so I'm very worried!

The above contents are transferred from the source: segmentfault? |? Author: Han Tianfeng (matyhtf).

 Watson Blog
  • This article is written by Published on December 2, 2017 13:18:23
  • This article is collected and sorted by the website of Mutual Benefit, and the email address for problem feedback is: wosnnet@foxmail.com , please keep the link of this article for reprinting: https://wosn.net/872.html

Comment