Why is foreign software better than ours? We can see from the design of the C ++ language.

Source: Internet
Author: User

I suddenly came up with a question: why is foreign software better than ours? From the design of the C ++ language, we can see why the default access permission of class members is private? There is only one answer, that is, to limit power to the minimum possible range. In the opinion of foreigners, this may not be a deliberate design, but an instinctive practice, because of their culture and system. On the other hand, we are used to maximizing power.CodeYou can often see a large number of virtual functions that can be private but written as public. The most common is the virtual functions of the derived classes. I have seen almost everyone write them as public, just like the base class, generally, we call them through base classes. Therefore, virtual functions of sub-classes can be private in many cases. In fact, we do not do this. We are used to maximizing power.

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.