The way of heaven, the way of balance

Source: Internet
Author: User

The way of heaven is not enough to be damaged. -"Huangdi's internal Sutra"

Do you think this sentence is familiar? It is actually from the Yellow Emperor inner meridian.
The most important point about yin and yang theory is that yin and yang are self-and (now usually translated as "mean").
Just as healthy people are the balance between yin and yang.
When one party is too strong, it is damaged, and one party is too weak to fill it.
What kind of balance is it? The point is to find the right balance. This is where the mystery lies.
Because the position of the equilibrium point varies from person to person, vary from occasion to case, change dynamically. There's no standard.
If there is any standard to say, I think it is probably "the best one".

What does this have to do with our program?
Because this view is the most abstract and basic, it is easiest to find its shadow in the program.

There is always a relative two aspects of things, there is no need to buckle up the yin and yang hat.
My understanding is that there will always be different solutions to the various problems encountered during the process. Each solution has its bit to do with the stronghold. The ultimate strategy for this problem is the tradeoff between the pros and cons of each solution, and the tradeoffs are everywhere.
No point must be good, the most suitable is the best.

There is such a view in design patterns that the most basic way to deal with change is to predict change and package change.
So is it the best design to encapsulate all the changes that could happen?
But once the encapsulation is equivalent to a layer of abstraction, abstraction will bring difficulties in understanding.
Often someone told me that C + + is difficult to read. That's because we're used to C code. C + + has many abstract usages compared to C, so it's difficult to understand.
Too many levels of abstraction bring about difficulty in reading, it is necessary to reduce abstraction.
Abstractions are too few to be modified and more abstract.
So the package change proposed in the design pattern is not to encapsulate all the changes, but to modify and read the tradeoff.

Coaches often advertise TDD to us, as this method of edge-development testing can effectively guarantee the quality of the code. Timely testing can also detect problems in a timely manner.
But really in the development process, no one used, because it is too tired to write.
I do not think TDD must be good or bad, in the development process with no TDD, or the use of any program, but the development and testing between the trade-offs.
Developers write code that is often developed and less likely to think about testing, so TDD's balance tends to be easy to develop. This section is also well understood.

In our file system, there is often a lot of data to manage. The most primitive method of data management is to arrange the data one by one, and to find the data in order from beginning to end. With the toes, you know, with the increase in data, the file system speed is certainly not fast.
So the bulls designed a variety of data structures, tree-based, such as B-tree, red-black trees. For different storage media, storage objects and other factors set.
The shape of the tree is different, the principle is the same, is to add some pointers in the appropriate location, pointing to certain data, and then based on these specific data further search, in a way to more easily find the data needed.
Of course, storing these pointers also sacrifices some storage space. Reasonable design data structure, but also more pointers, the faster the search speed, the sacrifice of storage space is more. The essence is the balance of time and space.

Such an example can also be cited a lot.

。。。 Here should have a summary, but I feel enough, can't write out ^_^

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

The way of heaven, the way of balance

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.