Chapter Thirty-fourth software technology topics

Conquer complexity

Reduce the complexity of software development is the core.

  • In the architecture of the system is divided into a plurality of layer subsystems, so that in mind certain period of time to focus on a small portion of the system;
  • Carefully define the class interface, so you can ignore the internal working mechanism of class;
  • Keep the abstract class interface, eliminating the need to remember unnecessary details;
  • Avoid global variables, because he will greatly increase the proportion of code is always the need to balance;
  • Avoid deep inheritance, because it consumes a lot of energy;
  • Avoid deep nested loop or conditional, because they can be substituted with a simple control structure, which consumes less resources of the brain;
  • Do not use goto, because they introduce a non-sequential execution, most people are not easy to understand;
  • Carefully define the error handling method, do not abuse the different error handling techniques;
  • To view the built-in system to treat abnormal mechanism, which will become nonlinear control mechanism. If abnormal unfettered use, and it will be gotoas difficult to understand;
  • Do not let the over-expansion of the class that occupies the entire program;
  • Subroutine should be kept short;
  • Use a clear, self-explanatory variable names, so the brain does not have to trouble to remember trivial details;
  • The number of arguments passed to the subroutine should be as little as possible. More importantly, just keep the transfer subroutine interfaces abstract necessary parameters;
  • Specification and conventions to the brain from a different code segments of arbitrary memory freed chance differences;
  • Whenever possible, avoid difficult chance.

Featured Development Process

First man to write programs, followed by the machine

Write good code readability, in order to facilitate others to understand. Readability of the following aspects of the program have proven effects:

  • Intelligibility;
  • Easy review;
  • Error rate;
  • debugging;
  • Modifiability;
  • Development time - a collection of the above factors;
  • External quality - a collection of the above factors.

Depth a programming language, not floating on the surface

With standardized concentrate

Specification is a set of tools for managing intellectual complexity.

  • Specifications can accurately convey important information;
  • Specification allows you to dispense various risks;
  • Specification increases the predictability of the underlying work;
  • Be able to compensate for the lack of specification language.

The problem domain-based programming

The program is divided into different levels of abstraction:

  1. Level 0: the operating system and machine operating instructions;
  2. Layer 1: The structure of programming languages ​​and tools;
  3. Layer 2: Lower implementation structure;
  4. Layer 3: Lower the problem domain;
  5. Layer 4: high level problem domain.

Low-level technical problem domain:

  • In the problem domain use classes to implement meaningful structure;
  • Hide low-level data types and its implementation details of the information;
  • Use named constants to explain the significance of the string and the amount of text;
  • Intermediate calculation result using the intermediate variable;
  • With complex logic determines that the Boolean function more clearly.

Beware of falling rocks

Note that the program every minor errors and warnings.

Iterative, back and forth, again and again

Rudang separate software and faith

Points

  • The main purpose of the program is to manage complexity;
  • Programming process have a profound effect on the final product;
  • Extensive communication between team members to develop requirements, even to interact with the computer. The single is the development of self-communication, followed by the computer;
  • Once abuse programming specification will only make matters worse. Used properly it can bring a good mechanism for the development environment to help manage the complexity and communicate with each other;
  • Programming should be based on the solution rather than the problem domain, it is easy to manage complexity;
  • Note the warning, which is as a programming doubt, because the programming is kept almost pure intellectual activity;
  • The more iterations while developing better product quality;
  • Legalistic approach contrary to high-quality software development. Please programming toolbox filled with a variety of programming tools, and constantly improve their ability to pick the right tool.

Guess you like

Origin www.cnblogs.com/liam-ji/p/11618483.html