Home  >  Article  >  Backend Development  >  How to solve the bottleneck of in-depth learning of PHP

How to solve the bottleneck of in-depth learning of PHP

PHPz
PHPzOriginal
2017-04-04 15:13:132059browse

PHP gives learners the feeling that it is easy when they first learn, but after 2-3 years of learning, they deeply feel that they have encountered The bottleneck is difficult to penetrate, and it would be a pity to give up. The feeling of "it's worthless, it's a pity to abandon it" is very appropriate. Backing off; after learning, there seems to be no progress;
if

...

else, loop You also know these, and you can even remember some things that others cannot understand Function, but when the project comes, I feel confused, even though I have a lot of words to say, I actually have no idea what to do when I encounter any problem... ...At this time, first of all, congratulations on your entry into the industry, and secondly, congratulations on having encountered the bottleneck of learning PHP in depth

But once you pass this level, your level of understanding will be even higher. One floor. But this level is not easy to pass. Because what hinders you is not PHP things, but many non-PHP things...

How to solve this bottleneck? Learning PHP?

1: In-depth understanding of

programming

ideasThe programming ideas involved in PHP development projects are: process-oriented programming implementation,Object-oriented

Programming implementation, aspect-oriented programming ideas;

is not just familiarity, but proficiency;

PHP starts with

variables

, branch statements, Loop statements, and then functions, so this is the programming idea you will encounter at the beginning: process-oriented programming idea. It is a processing idea that uses functions as units and encapsulates the code that causes duplication into functions. This kind of thinking can also be developed directly when developing projects. However, you will encounter a lot of repeated codes and you will create a lot of files. Therefore, the biggest feature of developing projects using only process-oriented programming ideas is: in the project Too many files... Too many files will make it difficult to control the distribution of folders, which is also not conducive to project maintenance and upgrades. It is difficult to build a large project, which is usually the same as a corporate website

#. ##You should reduce the number of files, then you need new ideas: object-oriented programming ideas. Its main features are: encapsulation, abstraction, inheritance, polymorphism,

interface

. ##Don’t memorize these things by rote, but fully understand them with practical principles, and at least be able to convince yourself. For example, let me ask you, why are inheritance and why are they based on polymorphism? Why do they look like that? This is the key point, and the difficulty is that you seem to have read it all, and you have read a lot of books, but when you use it, you seem to be confused. It's irrelevant. Because you haven't fully understood it. This will at least hinder your in-depth understanding of PHP's framework

. For example, many people use TP to develop projects and use Laravel to develop projects, but have you studied TP in depth? Source code? Laravel source code? What is Composer? Why is this so?

At this time, you should be at the stage of "reading a thin book but a thick one". You should fully search for the answers to these questions, ask more why, and then find the answers. In the process of finding the answers, you Unknowingly, the level has been improved...

Using object-oriented thinking to develop projects can greatly reduce the number of files, making your project compact, streamlined, but powerful. Good scalability. However, when your project gets larger and larger, you will find that there is still a lot of duplicate code. They are reflected in the inevitable duplication between files. This is not an object-oriented flaw, but a problem with the project itself. Object-oriented is just not powerful enough to solve these problems (even less process-oriented). At this time you have to upgrade your new thinking: aspect-oriented programming thinking. Maybe this idea seems vague to you. But if I say "set the data acquisition tag in the template", you should understand it.

Form:

5"

ord

er="id asc" limit="10">

《{$title}》- --{$author}

{$add_time

}

This is a method often used to obtain dynamic data when setting templates, but you can. Explain why you do this? And why it looks like this?

In fact, if you can answer these questions, you have entered the field of aspect-oriented programming thinking, because you need to deeply understand the template parsing engine. ....It is brought about by large projects but cannot be solved by object-oriented code redundancy. Only in this way can your project become bigger and bigger...

2: MVC, single entry, regular expression, etc.

MVC is not about memorizing these words, but a deep understanding of them. Understand why there are Controllers, Model, Views, and what their respective contents should be...

Regular expressions also require proficiency.

3: In-depth knowledge of the database

It’s time to start learning about database sub-databases, sub-tables, partitions, and database clusters.

Database optimization, such as: Index optimization, SQL statement optimization, etc.

4: Various cachingprocessing

such as: file cache, database cache, memory cache, etc.

These will involve many things, such as: How to write and operate configuration files, database cache tables, cache fields, etc. The introduction of NoSQL, such as: Memcache,Redis,Mongodb,....

5: The server

is mainlyLinux Server, there is a lot of content on it, and the first ones brought out are web monitoring programs such as Apache and Nginx.

There are also common programs such as ssh, ftp, etc.

Deeper, there is shell programming, and using shell programming to develop a server management system, such as: AMP, WDCP,.... These things may seem irrelevant to you who work in PHP, but if your website Can't access it, do you know what the problem is? So it's not irrelevant, but it's very relevant, so don't keep that narrow sense of limitations anymore.

6: Load balancing, website pressure resistance, etc.

These are necessary contents for building a project with development potential. How much do you understand? Related to PHP.

7: In-depth study of data structures

I believe you will listen when you learn data structures when you are a freshman. It talks about pointers, linked lists, queues, stacks, etc. It's a bit confusing, and you won't be able to use it very much. But at this stage you can study in depth, which will help you understand the principles of Apache, for example, and of course make it easier for you to use Apache. This actually helps you solve the bottleneck problem invisibly.

8: Need to learn the underlying language

Mainly: C language, C++; it can be seen that C language and C++ are very important basic languages. The PHP interpreter is written in C/C++, and the browser is also written by them. This is of course linked to your PHP application.

9: Strengthen learning at the application level

Such as: WeChat development, the use of various third-party plug-ins, such as: jquery,Layer,bootstrap,Uploadify. You can even write the necessary plug-ins yourself.

Don’t just limit yourself to PHP, but start working on the front-end, because front-end things can give you a deeper understanding of PHP. For example: extracting articles from the homepage of the website, if the numbers are 1, 2, 3, 4, 5, you can solve it from the front end, or you can solve it from PHP... What if you require more perverted information display? It is very likely that it is suitable to solve it on the PHP side or even on the database side...

Expanding your knowledge will help you learn PHP in depth...

In short , when you have a certain foundation in learning PHP, you will no longer easily say that PHP is easy, very simple, and you can learn it in two weeks and so on. You may even feel that you are getting smaller and smaller, and you still need to learn a lot of things. This is okay, at least you have really entered this industry, but you will increasingly encounter the bottleneck of learning PHP in depth. What's holding you back is a lot of non-PHP stuff. You have to use an open-minded mind to explore what you encounter. Don't be picky or picky, despise this or that, but complain all day long...

Just stick to it and solve each new problem. Why, your bottleneck will pass one day, and then you will truly have learned something, and become a master who is well-rounded and has the ability to comprehensively solve problems.

The above is the detailed content of How to solve the bottleneck of in-depth learning of PHP. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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