Home > Backend Development > PHP Tutorial > PHP programmers break through growth bottlenecks - with learning suggestions_PHP Tutorial

PHP programmers break through growth bottlenecks - with learning suggestions_PHP Tutorial

WBOY
Release: 2016-07-13 17:43:25
Original
827 people have browsed it

身边有几个做PHP开发的朋友,因为面试,也接触到不少的PHP工程师,他们常疑虑自己将来在技术上的成长与发展,我常给他们一些建议,希望他们能破突自己,有更好的发展。

  PHP工程师面临成长瓶颈

  先明确我所指的PHP工程题,是指毕业工作后,主要以PHP进行WEB系统的开发,没有使用其他语言工作过。工作经验大概在3~4年,普通的WEB系统(百万级访问,千成级数据以内或业务逻辑不是特别复杂)开发起基本得心应手,没有什么问题。但他们会这样的物点:


除了PHP不使用其它的语言,可能会点shell 脚本。
对PHP的掌握不精(很多PHP手册都没有看完,库除外)
知识面比较窄(面对需求,除开使用PHP和mysql ,不知道其它的解决办法)
PHP代码以过程为主,认为面向对象的实现太绕,看不懂

  这些PHPer 在遇到需要高性能,处理高并发,大量数据的项目或业务逻辑比较复杂(系统需要解决多领域业务的问题)时,缺少思路。不能分析问题的本质,技术判断力比较差,对于问题较快能找出临时的解决办法,但常常在不断临时性的解决办法中,系统和自己一步步走向崩溃。那怎么提高自己呢?怎么可以挑战难度更高的系统?

  更高的挑战在那里?

  结合我自己的经验,我列出一些具体挑战,让大家先有个感性的认识。

  高性能系统的挑战在哪里?


如何选择WEB服务器?要不要使用fast-cgi 模式
要不要使用反向代理服务?选择全内存缓存还是硬盘缓存?
是否需要负载均衡?是基于应用层,还是网络层? 如何保证高可靠性?
你的PHP代码性能如何,使用优化工具后怎么样? 性能瓶颈在那里? 是否需要写成C的扩展?
用户访问有什么特点,是读多还是写多?是否需要读写分离?
数据如何存储?写入速度和读出速度如何? 数据增涨访问速读如何变化?
如何使用缓存? 怎么样考虑失效?数据的一致性怎么保证?

  高复杂性系统的挑战在哪里?


能否识别业务所对应的领域?是一个还是多个?
能否合理对业务进行抽象,在业务规则变化能以很小的代价实现?
数据的一致性、安全性可否保证?
是否撑握了面向对象的分析和设计的方法

  当我所列出的问题,你都能肯定的回答,我想在技术上你基本已经可能成为架构师了。如何你还不能回答,你需要在以下几个方向加强。

  怎么样提高,突破瓶颈

  如何你还不能回答,你需要在以下几个方向加强:


分析你所使用的技术其原理和背后运行的机制,这样可以提高你的技术判断力,提高你技术方案选择的正确性;
学习大学期间重要的知识, 操作系统原理,数据结构和算法。知道你以前学习都是为了考试,但现在你需要为自己学习,让自己知其所以然。
重新开始学习C语言,虽然你在大学已经学过。这不仅是因为你可能需要写PHP扩展,而且还因为,在做C的应用中,有一个时刻关心性能、内存控制、变量生命周期、数据结构和算法的环境。
学习面向对象的分析与设计,它是解决复杂问题的有效的方法。学习抽象,它是解决复杂问题的唯一之道。

  “这么多的东西怎么学,这得学多久呀” ?

  如果你努力的话,有较好的规划,估计需要1~2年的时间,怎么学习的问题,我们后续再谈。


  (注:下面是原文作者左文建分享的学习方法)

  学习建议

  如何有效的学习是一个大问题。 自己有些实践但很零散,不好总结。昨天晚上睡觉前,突然想到了RUP的核心,“以架构为中心,用例驱动,迭代开发”,借用这个思想,关于有效的学习的方法,可以这样来表述:

  以原理、模型或机制为中心,任务驱动,迭代学习

  有点抽象, 举个例子来说明如何学习。

  目的: 学习如何提高处理性能。

  可迭代驱动的任务: 通过IP找到所在地域。

  这是WEB应用常见的任务,IP数据库是10左右万行的记录。

  第一次迭代: 不考虑性能的情况下实现功能(通过PHP来实现)

  因为无法直接通过KEY(IP)进行查找地域,所以直接放到数据或通过关联数组这种简单的方法都是不行的。思路还是先把数据进行排序,然后再进行查找


1. How to search by IP? For ordered data, binary search is the fastest.
2. How to sort? Of course you can use the library function sort, but since you are learning, it is better to implement quick sort yourself.

Learning objectives: Sorting algorithm, search algorithm

 PHPer’s data structure and algorithm foundation is relatively poor. I usually don’t have any tasks in this area, and I don’t learn it myself, so I lack knowledge in this area. However, the problems solved by programming will ultimately come down to the data structure and the algorithms that operate on this data structure. If the data structure algorithm is always in your mind, you will be able to clearly understand its inner structure when you encounter a problem, and the solution will naturally emerge.

Second iteration: Optimizing data loading and sorting

If you do the first step, it is basically still unusable because the data needs to be loaded and sorted every time, which is too time-consuming. The solution is to load and sort the data once and put it in a place where each PHP process can access it.

Put it in memcache This is an easy question for everyone. In fact, putting it in shared memory (supported by EA and other accelerators) is a faster way, because memcache also has more network operations. Whether the data is put into the shared memory as a whole or in chunks, how to test the performance? How to analyze the bottleneck (xdebug)? Driven by these issues, you will learn

Learning objectives: Methods to detect, locate, and optimize PHP performance; the impact of PHP implementation structure on performance.

The third iteration: Writing PHP extensions

The performance still cannot be improved, and I have to enter the world of C/C++. But from now on, you will not only be a PHPer but also an all-round engineer on the server side. Of course, this will be a huge challenge for students who have never done C/C++. I can't simply explain how to learn C/C++ here. You can refer to "PHP Programmers Learn C++"

Learning goals: Learning C/C++, writing PHP extensions

How to determine the mechanisms and principles that need to be learned? How to find the driving learning tasks?

I don’t have any idea about what I need to learn. How can I answer the above two questions?


Find out the key points that need to be learned from the positioning of this technology, that is, how it does it (mechanism) and why it can do it (model or principle)
List the most common aspects of this technology Application, as a learning task, is carried out from simple to difficult.

If I need to learn Javascript, I have some perceptual knowledge of HTML and CSS

First of all, I learned that JS is a dynamic language in the WEB field, which mainly solves the dynamic interaction of web pages.

Then the key points I want to learn are as follows:


How JS interacts with HTML (mechanism)
What are the dynamic characteristics of JS, and how are they different from other dynamic languages? (Language model)

If you are completely self-study, find the key points that need to be learned (mechanism, model, principle). Setting learning tasks is indeed not that easy to grasp. If you find an experienced person to guide you or add a learning team, the speed of learning will indeed be greatly improved.

Finally, what I want to say is: PHP is used because it is simple, but its simplicity cannot limit our growth!


Author: Zuo Wenjian

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478836.htmlTechArticleI have a few friends who are engaged in PHP development. Because of interviews, I also came into contact with many PHP engineers. They often If they have doubts about their future growth and development in technology, I often give them some advice. I hope...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template