Dahua design mode (three copy vs multiplexing) _ side-dishes programming growth in mind

Source: Internet
Author: User
Dahua design mode (three copy vs multiplexing)

(Continuation of the article)
Side dishes: "I see, he said with any kind of object-oriented language implementation, that means to use object-oriented programming method to implement, right." OK, I've learned this, but I didn't think of it at the time. ”
Big Bird: "All programming beginners will have such a problem, is to encounter problems on the intuitive use of computer can understand the logic to describe and express the problem to be solved and the specific solution process." It's actually a computer way of thinking, for example, calculator this program, first requires input two numbers and operation symbols, and then according to the operational symbols to determine how to choose the operation, get the result, this itself is not wrong, but this thinking makes our program only to meet the current needs, the program is not easy to maintain, not easy to expand, More difficult to reuse. Thus the requirement of high quality code is not achieved. ”
Side dishes: "Brother Bird Ah, I am a little confused, how to easily maintain, easy to expand, and easy to reuse it, can be specific points." ”
Big Bird: "For example, I now ask you to write another Windows calculator, your current code can not be reused." ”

Side dishes: "That's not easy, just copy the code in the past." Changes are not big, not trouble. ”
Big Bird: "small dish seems to be a piece of cake, some people say that the work of junior programmers is CTRL + C and CTRL + V, which is really bad coding habits, because when your code repeated code to a certain extent, maintenance, it may be a disaster." The larger the system, the more serious the problem it poses, the principle of programming is to avoid repetition in the best possible way. Think about the code you're writing that has nothing to do with the console, but just the calculator. ”
(to be continued) Origin: http://www.cnblogs.com/cj723/archive/2006/08/30/490253.html

Related Article

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.