comp1531-软件工程(一)代码设计原则

1 DRY

"Don't repeat yourself" (DRY) is about reducing repetition in
code. The same code/configuration should ideally not be
written in multiple places.

2 KISS

“Keep it Simple, Stupid” (KISS) principles state that a software
system works best when things are kept simple. It is the believe that
complexity and errors are correlated.

3 Minimal Coupling

Coupling is the degree of interdependence between
software components.

4 Top-down thinking

Similar to “You aren’t gonna need it” (YAGNI)
that says a programmer should not add
functionality until it is needed.
Top-down thinking says that when building
capabilities, we should work from high levels of
abstraction down to lower levels of abstraction.
Why do we care?
Removes unnecessary code, less to maintain,
less likely to cause problems

Guess you like

Origin blog.csdn.net/weixin_42089190/article/details/120788867