Proud of PHP

There is a common refrain in Web development: PHP is the best language in the world!! Even people outside the circle have heard of the meme.

My introduction is in the outsourcing company DedeCMS set station began. At that time, IT was recommended that PHP is fast to get started, low threshold, friendly to newcomers and into the pit. Looking back over the years of development, from DedeCMS/TP/CI/Discuz! / ECMall/ECShop/Laravel/frameworks/libraries that everyone is very familiar with.

However, as the survival environment of small and medium-sized companies becomes more and more difficult, the popularity of cloud computing and microservices technology gives Java projects inherent advantages. Python benefits from mature and rich class libraries and artificial intelligence, coupled with the rise of Golang and JS full stack technology, the advantages of PHP are increasingly weakened.

There’s no denying it: PHP is still the best language in the world, but as developers, we need to be aware of where we stand and where we’re headed, be vigilant, and be cautious — PHP developers are becoming less competitive in the workplace.

In 2019, there was an article like “PHP is not the bird it was ten years ago”, and even at the end of 2019, Han Tianfeng published his thoughts on PHP development in the New Year with the title “How to use PHP correctly in 2020”, reviewing the development of PHP and expressing the performance improvements of PHP7. PHP8 JIT performance will track Java/C++/Go, as well as the Hyperf/Swoole high performance framework.


We are all seeing the PHP ecosystem getting richer and richer, even as efforts are being made to fill in the gaps. But have these two points been taken into account?

1. Do developers buy it? For example, when considering performance, microservices, etc., will PHP still be chosen as the project selection when there are already mature solutions? Why not Java/Golang? What are the advantages of PHP at this point? Because of the few PHP boys I have? Is forcing PHP to solve performance and microservices problems more overstretched?

2. What are the advantages of PHP? Is it really possible to force a race against other programming languages?

An embarrassment toPHP

There are also voices in the community that preach or indulge in PHP fantasies about how many major websites and companies around the world are using PHP. But have you ever thought about the scope of use and the business you support? Does this prove that “PHP is the best language in the world” really hold water?

Sticking to PHP and writing a few if else or Laravel or other container dependency injection and other design patterns to solve small to medium sized problems is fine, but going further, bigger businesses and teams, as an enterprise application is PHP’s awkward place to be.

Here, remember ruan Yifeng’s article shared earlier, you can also see if it is relevant “PHP sucks? My opinion”, this article was published 10 years ago.

Crossroads of The Times

In 2019, I participated in some technology sharing on weekends or after work. Now I think many of them are biased towards Java middleware, EFFICIENT operations, ElasticSearch, Serviceless, K8s, Flutter and big front-end, Dubbo and microservices, etc. More and more new technologies, hits, and trends seem to be sidelining PHP. In the middle of the year, it was even reported that the files under the Technical committee of Xiaomi would no longer be used for PHP projects. At the end of the year, it was even reported that a large factory directly laid off its PHP project team.

We can’t say PHP is “dead”, but we’ve all seen PHP fall by the way, and it seems that more and more PHP developers are switching to Golang this year, so some people online say that more than half of the Golang community is from PHP. It’s a joke, but it makes sense.

Now that we’ve calmed down, is there a better choice than to embrace Golang?

How does PHP build its competitiveness?

In fact, why PHP is at the end of the contempt chain, I think of 2GUa or someone said on Zhihu, the general idea is not to despise PHP language itself, but only to write PHP development. Because PHP is friendly to beginners, even the worst code can run. Although PHP has introduced object-oriented support since 5, many people still think of it as a noodle oriented process to get started quickly. Although PHP code is fast, it is difficult to maintain, performance is insufficient, and bugs are frequent. Of course, I’ve seen garbage written in Java, and the maintainability and performance of the code is not directly related to the development language.

If you can’t write good code with basic features in one language, it doesn’t matter if you switch to another. You’ll write just as bad code. All too often I see people who write really messy, really bad Java code, and then curse it and want to switch to Go. What these people don’t understand is that writing good code depends on the person, not the language. — Wang Yin, How to Master All the Programming Languages

The surefire way to improve your programming skills is to read more good code

Instead of just learning a few design patterns, there are plenty of articles on this topic. In this regard, take more time to Github, see the latest code, see how everyone is written, do not necessarily come up to see a framework of large project source code, you can start small and elegant class library, slowly develop interest and habits.

Many people are just trying to make a living, but hopefully you’ll find programming fun

Because the IT industry is hot, more and more people are willing to become “code farmers”, although IT is self-mockery, but I really do not suggest that we should think so, I hope that we are a “creator”, is to rely on creativity and ideas to complete a product or a project.

We are Makers.

We are Software Engineers.

It was the best of times, it was the worst of times.

Don’t look down on other professions because of the high salary or high quality of programmers (compared to the input and remuneration, programmers are not necessarily high salary), nor code farmers (brick moving) let oneself numb into manual labor or just a job positioning themselves, learn to balance work and life, continue to learn.

Supplement computer and other software knowledge

If you have to say, we are also eating professional food.

Technical work, with the ability to eat, no matter you are trained or halfway, since you are invested in the software development industry, should keep improving, let yourself professional, rather than the impression that PHP gives people wild way, simple and rough, can use it. With VAR_dump die debugging go the world.

If the data structure and algorithm feel too far away, you should also understand the basic operation and maintenance of Linux operating system, distributed data storage, high-performance cache, solutions to common business scenarios, and software development process, and be able to solve problems on your own. The more you learn, the more you will understand, and the solutions include “layered design”, “divide and conquer”, “space and time trade-offs”, “efficiency improvement and consumption reduction”, “professional people do professional things” and so on.

Workplace competitiveness

Think about your interests. Switching to a development language is not necessarily the only solution. To learn about technology, pay attention to technical forums, especially what technical events are talking about, or job listings on job boards.



Be open-minded and keep learning

Don’t think of yourself as a developer of a particular programming language. Pay attention to technology trends and embrace The Times, so as not to be obsolete. Because if you do not revolutionize yourself, you will be laid off by the revolution of The Times. The value of a programmer is to solve problems, and the value of software development is to deliver as many useful functions to users as possible.

Focus on the open source culture and don’t waste energy on solved problems.

Communication and self-management

Communication attitude, emotional control, tone, multi-party coordination, work summary and reflection, etc

PHP where to go

PHP development jobs are declining. If you look at job boards, PHP development jobs fall into two categories: 1. Back-end or OA development; 2, open source e-commerce site maintenance or two open.

What other choice do we have?

  1. Golang and other mid-platform or middleware development
  2. Java ecosystem and distributed systems such as microservices
  3. Python, and the conversation
  4. Docker and K8S cloud native architecture
  5. Vuejs/ReactJs/Flutter and other large front-end

The above

At this moment, at 1:30 am on January 3, 2020, I finally sank down to make a reflection and summary. It is also a communication and sharing with more PHP development, the above is my personal perception, if there is any bias, please correct and criticize.

Do you have a plan for your development path this year?


supplement

When I brought up this awkward topic again with my friends in recent days, I wondered, “Can Swoole and Hyperf support PHP again?” If you are interested in this issue, you can also see >> the original post







The last

With an open mind and an effort to move forward (money), tools and programming languages are built to solve problems and have scenarios and areas where they are good or bad.