Simple design means writing only the necessary code, using the most concise code to implement the current requirements, to keep the program structure as simple, minimal, and expressive as possible. Keep it simple, Stupid “is also known as KISS (Keep it Simple, Stupid).

Video Address:www.zentao.net/xp/xp-simpl…

Many software designs implement this principle well, such as the well-known Unix. Many of the principles of Unix philosophy also embody simple design:

1. Rule of clarity: Code should be clear, not obscure. Clear code is less likely to break and easier to understand and maintain. At the same time, we should pay attention to notes to avoid difficult reading and maintenance in the future.

2. Simplicity principle: Complex software has a higher probability of bugs, so the code design should be as simple as possible to reduce maintenance costs;

3. Combination principle: different programs are connected through interfaces, and interfaces communicate with each other in text format, because text format is the most easy to handle and the most common format;

4. Modular principle: Do one thing per program, don’t try to do multiple tasks in a single program. In Unix, for example, pipes are the output of one program and the input of another program, each focused in a particular direction.

5. Rule of Optimization: Don’t even think about optimizing a feature until it’s implemented. After all, “Run first, then get it right, then fast.”

Unix programmers’ pursuit of simple design stems from a pragmatic fact: complexity is cost. Complex software is harder to develop, test, debug, and maintain.

How to make simple design?

In Deconstructing Extreme Programming — Embracing Change, Kent Beck lays out four prioritized principles for simple design:

  • Pass all tests: the code passes the various tests written in the project and is ultimately accepted by the customer;
  • Make it as clear as possible: All code expresses the author’s intent, which is simply to make the code as readable as possible.
  • Eliminate duplication as much as possible: repetition, meaning low cohesion, high coupling. Eliminating repetition will help improve the responsiveness of software;
  • Fewer code elements: Minimize code elements and keep them simple to reduce code complexity.

The simplicity and courage that are core values of EXTREME programming are well represented in simple design. In the actual project development process, simple design is not not to consider the future, but in the face of system change, the team should have enough courage and confidence, believe that we have the ability through reconstruction, to cope with new challenges and changes. So, how do teams refactor that? I’ll see you in the next video.

More wonderful video sharing: www.zentao.net/page/colleg…