Analysis on the Relationship Between algorithms and Design Patterns

Source: Internet
Author: User

Some people say that they have learned programming in ten days, and some say that they have learned programming in ten years. The former is about ten days to learn grammar, and the latter is about ten years to reach a very high level in programming ideas. However, I personally think that it is too bad for me to learn a syntax for ten days. I dare to write a book named "ten days to learn XXX". But it is no exaggeration to learn programming in ten years!

 

The Program Design Concept mentioned above should include two aspects: algorithm design and design pattern. Here we talk about two aspects, because we usually share these points. I personally think the design pattern should belong to algorithms.

When it comes to algorithms, those who do not know the algorithms will immediately think of the data structure. I remember that during an interview, the interviewer said, "algorithms are data structures.", I corrected: "different algorithms emphasize ideas and methods, while data structures emphasize data storage methods, the latter is the basis of the former. "The interviewer was unhappy when the error was pointed out. I will immediately say," come on here. Please wait for a notification. "Khan, so, what is an algorithm? reference a sentence in the book: An algorithm is the soul of a program.
Specifically, the algorithm emphasizes details, and the design model emphasizes the overall design framework. For example, the design pattern is a macro object, and the algorithm is a micro particle. When it comes to the microscopic and macro aspects, you may have seen a pair of pictures: a python hashes its own tail. This is the relationship between algorithms and design patterns.
Some people do not have good algorithms, or they do not know algorithms at all. They say, "I don't want to learn algorithms. I only want to learn design patterns. I can also be a programmer." This is definitely not true! Coder with very good algorithms won't be a programming guru. Even if you think that your design model is amazing, you just think that. The number of programs designed by the experts in the design pattern of the algorithm is just a function. It is hard to say how high the quality is. On the contrary, even if a person with good Algorithms does not design a pattern, the pattern should be at least three points.
Therefore, in the process of learning the design model, it is necessary to strengthen the quality of algorithms. It is not necessary to give away the contents one by one.

The above is my experience in learning the design model.

 

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.