When can I learn data structures and algorithms during PHP learning?

Source: Internet
Author: User
When learning PHP, what stage can we learn the data structure? This problem is not only about learning PHP, but also about other languages.

When learning PHP, what stage can we learn the data structure? This problem is not only about learning PHP, but also about other languages.

Do not follow suit on this issue. do not be ahead of schedule. that is to say, do not study immediately when others say this is important on the Internet, or do not see others say it is abstract and difficult, you don't want to learn. In general, this thing is to learn and must be learned. The key is when to learn it? How to learn?

If you do not learn the basics of the language well, do not learn Data Structures and Algorithms. Otherwise, you have been studying the language for a long time. it is not only flashy, but also useless, but also a great blow to your interest in learning.

For example, if you have been studying PHP2 for more than a year, you have used PHPCMS in your company's development projects. When have you used algorithms in the data structure graph taught in university textbooks? Or the Harman algorithm? However, you are qualified for many projects developed using PHPCMS, and your salary may not be low.

On the other hand, even if you are familiar with the complex algorithms of the tower, but you do not have time to learn PHP and PHPCMS, you apply for a PHP Development Position. do you think there will be several interviews? On your resume, you can only write "proficient in data structures and algorithms", but it cannot be used in practice, and the ending may be embarrassing.

Even if others do not know what the data structure is, they can still find a job, so they don't need the data structure. This shows that the work in the development and application fields, such as finding a job or even PHP, is directly linked to the requirements, and the talents in this field will be needed only when what is used in the work.

Therefore, if you do not want to learn the data structure, it depends on the job you are looking for in the future. If you are looking for a job in the PHP rapid development project, you will be very skilled in the framework you need in one year's post. you may be a technical manager. However, you may not use complex algorithms in data structures.

So there is a misunderstanding: whenever you want to learn PHP, you must first thoroughly understand the data structures and algorithms. it is also limited to the algorithms written in books, such as the Homan algorithm, hash algorithm, and so on... no one will develop projects if they don't learn this... and so on.

As a result, many beginners have not even learned the basics of PHP, have not even understood the object-oriented language, have not even understood the template parsing engine, and have no idea why dynamic tags are required, even Laravel cannot develop a complete project. as a result, Laravel is reading the data structure book, which is purely "flashy.

This is learned to show others how advanced they are ". In fact, he cannot figure out why he wants to learn it and where it is used. This learning is very out of practice. it is also normal if you are in trouble finding a job and are difficult to meet your job requirements. Because you have learned something wrong. Just like you are proficient in history, but you are looking for or doing chemistry work, and then you say to others, "History is very important ...".

Therefore, the above suggestions are: work or future work is not available, so you do not need to learn the data structure for the time being.

So when should we learn the data structure?

It is natural that learning is required only when it is used. When will it be used? Like sorting in the data structure, these methods have already been integrated into arrays in PHP. this can be done using an sort () method. do you need to write it yourself? I believe that when you want to sort the result set extracted from the database, your first choice will be those database functions, and you will not write any sort algorithms by yourself, because you are making the wheel again.

Many people boast of the importance of complex algorithms. How did you use the Harman algorithm in your project after several years of working in PHP? Hash Algorithm? Tower algorithm? Have you ever written a linked list in PHP? Where did you use it? You don't need to write it because it's all done.

PHP arrays are dynamic, that is, linked lists. do you still need to write them? Functions written by other libraries are much more efficient than you, and more situations are considered. What kind of dynamic array do you write that can be used only for general purposes? Unless not, you must write it. For example, recursive processing of website columns. In the development field, many of them come to the forefront, because we need to reduce repetitive tasks.

You can only use a framework from start to end. But how many of them are writing their own frameworks? When it comes to what is really needed, many people may say this: Isn't there a framework? For example, TP, such as Laravel. even open-source systems can cite more than a dozen common excellent ones. If you know this, what is the significance of the complex algorithms you have learned?

Therefore, the above suggestion is: if you want to study the development of the framework and the development of open-source systems, then you can learn the in-depth data structures and algorithms. Otherwise, you will not be able to use it. Let's learn about it first, such as object-oriented, such as face-oriented, such as template parsing engines, such as cache processing, such as server load balancer, such as clusters, such as Linux.

How to learn the data structure?

How can you learn the data structure? In fact, it is integrated into your daily life ......

For example, if you need to print extracted articles starting from 1 during project development. During the traversal, the index starts from 0, so you only need to add 1.

When you need to perform a red mark on an even number of rows, you only need to take the remainder of 2 and check whether the result is 0 or 1. this is actually an algorithm. what is an algorithm? It is the way to solve the problem. in this way, the concept of pseudo algorithms will appear, that is, the solution process is first written in Chinese or English, and then implemented in a certain language.

As for the algorithms described in the book, they are used in underlying fields such as development and compilation performance, distribution of operating system queue tasks, and so on. will you do underlying driver development in the future? Do you want to write a compiler? Do you want to write a browser? If you don't want to, what is the practical significance of the dead books?

Therefore: do not think that data structures and algorithms are the abstract problem-solving code listed in a university textbook. This is too narrow. In fact, those who are more "unlearned" people are doing "academic Display", which also insulted the purpose of the true programming predecessors. I believe there are people around you, right, those people.

If you don't get it, you can say a bunch of technical terms that you don't understand. if you're confused, you can give him a lot better than you. It makes you "worship ". This has achieved his "vanity" goal. In fact, many technical staff in many companies have such a floating mentality. I always like to shock you with something that you don't understand, so that you don't dare to go deep into his technical strength.

In fact, this also involves two different development directions: technical teaching and technical development. The former is to make it easier for you to learn easily with easy-to-understand content, and the latter is to make it easier for you to see that it is better than you. This is why many technical experts do not understand technical teaching. This topic will be discussed later.

So what are the real data structures and algorithms? The real and practical data structures and algorithms are actually used by you without your attention. In this case, the data types you have created during development, such as int, char, string, and Struct. the class type is the data structure.

You add, delete, modify, query, sort, and construct a linked list to form a dynamic array. how to extract a member is actually an algorithm. The above is to combine these basic solutions with the actual problems. So: the algorithms such as the Tower of Hanoi are actually an application.

This is why it seems that you have met these problems, but the problems encountered in the project will not be solved. Because you don't have a solution to this problem, you naturally cannot write the algorithms required for that problem. However, many people mistakenly believe that algorithms are the code that has been written by the programs listed in the book. This is too narrow.

This is why we need to solve a problem in actual project development. we need to write a pseudo algorithm so that you can write a corresponding program to solve the problem. You can write a program to implement it, that is, translating your pseudo algorithm.

The biggest misunderstanding is to get rid of the reality and abandon the foundation, and blindly pursue the "algorithm" of the code example in a narrow sense that is not used and time-consuming. it is the root of your interest in learning. If your interests are wiped out and you want to turn around, what is the significance of memorizing the things that are not used for display?

So: You have been learning and using data structures and algorithms!

Because: data structures and algorithms are essentially a way to think about problems. you need to learn more than just the examples listed in books. It is also a kind of thinking of our predecessors to solve problems, and the truth learned from the objective world. Just like why object orientation is needed, it is to be able to describe the individual in the objective world in a more complete manner ......


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.