Management complexity-code Daquan study Note 2

Source: Internet
Author: User

The primary technical mission of software is management complexity. Why?

Complexity:

 

You have had such experience: At the same time, you will surely lose nothing!

Although you are very busy, the results are not satisfactory.

Or one thing, but there are too many things that you always want to do at a time. Here we also do it. The results are messy and you can try again ......

Human Brain has limited processing capabilities and cannot focus too much on things at the same time. Too many things will lead to some omissions and confusion;

It's like playing a juggling game: The two balls that are left in the air are relatively easy to control, and the complexity of the two or more balls increases greatly;

InCodeDuring the design process, if you focus too much on it, the more complicated it will be, the more complicated it will inevitably lead to omissions and errors.

Too many things or logics need to be followed at the same time are not advisable, but there are many logic and complicated things in the software.

To ensure the performance of all aspects of the Code, management complexity becomes very important!

 

How to manage complexity in software:

LMinimizes the amount of essential complexity that anyone needs to deal with at the same time;

LDo not let unexpected complexity grow at a rate without fear;

 

Some principles to be followed in code design to help manage complexity:

Minimum complexity: allows you to focus onProgramAnd ignore other parts with peace of mind.

There are many design principles for reducing dependencies between systems: Inter-module dependencies, platform dependencies, and so on. The principles currently come into use and are actually applied:

Streamlining: The code should be as logically clear and structured as possible to eliminate useless code. For example, a function is a logic, and a class has a single function;

Hierarchy: Hierarchical design of the system, access interaction by hierarchy, and unified abstraction of the dependent parts to provide consistent interfaces.

The lower layer feels "simple and beautiful" to the upper layer. Just like the iPhone, it looks beautiful and simple. It encapsulates complicated things.

Loose coupling: Minimize the associativity between programs, abstract encapsulation and information hiding between modules and classes;

In order to reduce the association between them, the interaction mode is simple and simple.

Reduce dependency: System dependency and external module dependency. No dependency is impossible. We can only reduce dependencies and encapsulate the dependencies.

Reduces the changes caused by excessive dependencies when the system or module changes.

And so on.

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.