PHP bird brother: I used to be "not suitable" for programming

Net name: Snow Migratory Bird, everyone is called Brother Bird, Hui Xinchen @Laruence, is the most influential PHP technical expert in China, a core member of the PHP development team, a PECL developer, and an external consultant for Zend. He has worked for Yahoo, Baidu, and now Sina Weibo is the Chief Architect and Chief PHP Consultant of the Platform and Data Department. Hui Xinchen is the core developer of PHP NG and the main developer of PHP 5.4 and 5.5. As a PECL developer, he has contributed Yaf, Yar, Yac, Taint and other excellent open source works, and is also the maintainer of APC, Opcache, Msgpack and other projects.

From a beginner searching for PHP tutorials on the Internet, to a core member of the PHP development team, Hui Xinchen felt that the whole process was like "fighting monsters and upgrading". Like Java, PHP is also known as a blue-collar language. In his view, it is the cradle that can cultivate more programmers. In an era where everyone can program, there will inevitably be more talented people who can promote technological progress. He shares research, technology, news related to the PHP language and Zend Engine on his blog, "Snow Corner". Left-hand code, right-hand poem.

Q: How did you get interested in programming?

It seems that my first "programming" was still on the Xiaobawang learning machine. Later, the university studied computer, and when he was a graduate student, he was responsible for the campus construction of the school. He actively or passively did a lot of web development work, including the website of many secondary departments of the school at that time, and the maintenance of the campus BBS. Thinking about it, there seems to be no such thing, or an opportunity to say that I like programming. I felt that I was in this industry naturally, and I didn't think I disliked it, so I just did it.

Q: How did you fall in love with PHP? How did you become a core member of the PHP development team?

At that time, when I was a graduate student, I wanted to make a website. If I didn’t know it at all, I searched online. I just found a PHP tutorial to teach how to make a simple website. , deployment (there was no centralized deployment tool at that time, but there were also many tutorials on how to deploy LAMP), writing code, and testing were very convenient, the syntax was very similar to the C language, and even the names of many APIs were the same as libc APIs . So began the indissoluble bond with PHP.

It should have been in 2011. At that time, Ap (the predecessor project of Yaf) was developed for Baidu. At that time, it was used well in Baidu. So I thought of contributing to PECL. After some modifications, it was renamed Yaf (Yet another framework, the name is also a bit self-deprecating, because there are many frameworks in PHP), so I sent an email to the PHP mailing group, because English was poor, so the process was still tortuous, but fortunately Pierre Joye helped me a lot at that time, let Yaf entered PECL.

In addition, before submitting Yaf, I had been researching the source code of PHP, so I also submitted a lot of bugs and fixes. For example, I remember one day at noon, Rasmus (the father of PHP) said that he found a bug on IRC, and I was almost 5 years old. Fix was given in minutes.

After I slowly got to know some people and gained everyone's trust, I initiated an application, and then obtained the submission permission of the PHP core code, participated in the direct development of PHP and bug fixes, and became a member of the development team. .

As for the core, it is accumulated gradually, and it is actually a process of mutual trust. If your work is recognized by everyone, then your opinion will be respected. I slowly became familiar with Dmitry Stogov, got the commit permission of the core part of Zend, submitted many core bug fixes and new features, and later became an external consultant of Zend, and slowly became a Core Developer.

Sounds like a bit of a monster upgrade.

Q: How did you develop Yaf? How did Baidu support Yaf development at that time?

Before Yaf, there was a classic debate about using or not using a framework: "Using a framework will reduce performance, and not using a framework will reduce development efficiency."

At that time, there were many internal frameworks in Baidu, including open source Yii, ZF, etc., as well as those written by some teams themselves. One problem in this way is the class library, and some peripheral facilities cannot communicate with each other.

Another reason is that after many framework authors release the framework, they will find that different people will make various modifications to the framework. As a result, after a long time, when a framework is released, it will become a variety of variants, and subsequent unified upgrades will also becomes impossible.

So, I decided to use a PHP extension to implement a framework to solve these problems. Of course, I was not very confident before writing this extension, and I don't know how much performance improvement the extension can bring. Fortunately, the final result is very good.

Q: Why did you choose to write Yaf in C?

PHP is written in C language, so his extension is also written in C language, so he chose C language to write Yaf.

Q: Why did you leave Baidu and come to Sina Weibo?

There are actually many reasons for this. For example, it was T7 in Baidu at that time, and I was less involved in business affairs. I felt like I didn’t have so many things to do, and I felt a little wasted.

In addition, I was in Baidu's commercial search department at the time, and I didn't have direct contact with the system with a large number of visits, so I also hoped to find a large platform to practice, and Weibo happened to be such a platform.

After coming to Weibo, I have indeed come into contact with many challenges that I have not encountered before, and I also feel that my knowledge has a bigger stage to play on.

Q: What is your specific work on Sina Weibo?

I am now in the Weibo Technology Department with a basic service team. Our main work is also divided into stages. The main work in the first two years is to optimize the performance of Weibo LAMP, including various basic frameworks, tool development, environment optimization, Specification making, etc.

In the past two years, Weibo's LAMP architecture has stabilized, and the overall performance has been improved several times. We also have our own high-performance LAMP overall solution. So there is less work for LAMP optimization. Now the main focus is on the research and development of infrastructure, such as cache middle layer, transcoding service, communication platform and so on.

Q: Does PHP7 (PHPG) take the needs and pain points of using PHP on Sina Weibo as an important feedback?

Of course there is. Since I joined the development team, I have had similar arguments with many other members: I think performance is very important, and some people think that new features are very important, then when a new feature affects performance We will have disputes.

I'm very paranoid about performance improvements, which is why I've worked with Dmitry Stogov a lot since then, because he's also very concerned about performance.

The main reason I care about performance is that I have a very real experience of the value that every 1% performance improvement can bring to Weibo, the largest LNMP platform in China. At present, although the overall performance of our Weibo has been greatly improved compared to two years ago, I realize that without affecting the development efficiency, further improvement can only depend on the performance improvement of the language and environment. So this part is Weibo's demand for PHP.

Compared with 5.6 on WordPress, PHP7 has a real performance improvement (QPS) of more than 100%. I believe that next year, after the release of PHP7, various businesses of our Weibo LAMP platform can also get a 100% performance improvement.

Q: What was your process for participating in the development of PHP7 (PHPG)? How did you collaborate with other development team members?

PHPNG was a secret project at the time. The original participants were only Dmitry and me. I still remember that in the spring of this year, our PHP5-based JIT project was shelved because of its unsatisfactory results, and everyone was depressed.

Dmitry said he had an idea to redesign ZVAL and compress the size to reduce memory usage. Then the two of us discussed it, because in fact, we have various ideas every day, so we just thought: Well, this idea may work. But not very confident.

The main idea at the time was to quickly make a working prototype to test the effect. In this process, we mainly discuss ideas, and then implement the parts to be done separately, and then merge.

The main tool for cooperation is still Skype, but because he is in St. Petersburg and has a time difference with us, he also communicates by email and reviews the code through Github.

By the time the project was almost done, we realized, "Hey, that's a good idea, it's working". Then it was made public. After that, it became a normal mode of collaboration between everyone. If you have an idea, submit an RPC, submit a Patch, vote, everyone Reivew, and then merge.

Q: What features has PHP7 added or removed so far? How else will performance be improved before release?

There are many, in addition to the PHPG branch that mainly provides performance improvements, we also have AST (Abstract Syntax Tree) support, Uniform Variable syntax, 64bits length string supports, some new syntactic sugar, and more recently Native TLS, etc.

PHP7 will be officially released in October 2015. Before that, we still have some ideas to try, such as using zend_array to directly replace Hashtable; such as re-sectioning and sorting by specifying functions to reduce iTLB misses; such as optimizing part of JIT (Type knockdown) is introduced into PHP, with some type-specific OPCodeHandler to speed up; another example is to further improve code data locality to reduce Cache miss and so on.

Of course, we also have a JIT project working on it in parallel, but I'm worried that this project will not be ready by the time PHP7 is released.

Q: Will new versions of PHP be a direct upgrade to PHP7 over PHP6? Why?

The main reason for this is that there was a development version of PHP called PHP6, but this version failed and was not released. Therefore, this version should be PHP7.

Q: What is the relationship between the language Hack released by Facebook and PHP? Is the purpose of Hack to replace PHP? What are the advantages of these two languages ​​compared to each other?

It doesn't matter too much, Hack is not PHP. Speaking of replacement, I believe they (Facebook) may have such an idea, but it depends on whether the community accepts it or not.

I'm not particularly familiar with Hack, so I can't make a specific evaluation.

Q: Some people think that because PHP is easy to learn and has a low threshold, some people who are not suitable for programming have flooded in. What do you think of this view?

I really don't agree with this point of view. When I was graduating from my undergraduate degree, I also tried to find some development jobs. I interviewed for several units, but all were rejected. Maybe in the eyes of those who interviewed me at that time, I was not suitable for programming.

However, because of the low threshold of PHP, people can quickly see the results of their "programming", which will have a positive feedback and incentive effect on the novice, and make interested people more interested. And the more people who program, the greater the probability that there will be people who will produce big cows and contribute to the overall technological progress.

Moreover, the future programming language must be developed towards ease of use, further lowering the threshold of programming, and maybe one day everyone can program!

Q: What is the knowledge structure of a qualified PHP engineer?

I remember there was a saying in the past: "PHP engineers are a panacea". In fact, this sentence is not only applicable to PHP engineers, but should be applicable to all engineers.

The knowledge structure should be very broad. There are many technical points involved in web development. In addition to HTML, CSS, JS, and SQL, you also need to know some common methods for configuration, maintenance, and troubleshooting of Nginx, Linux, and Mysql. You should understand some of these.

Q: Besides technical ability, what else do you focus on when interviewing?

I pay special attention to clarity of thinking, communication, and speaking. In fact, to put it bluntly, if we work together in the future, will there be obstacles and whether there is a great growth potential.

Q: Chen Bole, the former webmaster of phpe.net, is now selling men's socks. What are your plans for the future? Will it always be a coder?

In fact, I am a very lazy person, and I never think very far. I am drunk now. So I am not very clear about the future. I just think that I still like programming. I like to benefit everyone through my work and get praise from the community. I think this is good, and I will continue to do it.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324638898&siteId=291194637