设计原则

来源:互联网 发布:手机淘宝评价怎么上图 编辑:程序博客网 时间:2024/09/21 08:51

Just YAGNI, DRY and KISS for everything.

 

YAGNI - You ain't gonna need it

YAGNI is the principle in extreme programming that programmers should not add functionality until it is necessary. Ron Jefries writes, "Always implement things when you actually need them, never when you just foresee that you need them."

 

DRY - Don't repeat yourself

In software engineering, Don't Repeat Yourself or Duplication is Evil is a principle of software development aimed at reducing repetition of information of all kinds, especially useful in multi-tier architectures. The DRY principle is stated as "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system." The principle has been formulated by Andy Hunt and Dave Thomas in their book The Pragmatic Programmer. You can use refactor to remove duplication.

KISS - Keep it simple stupid  by Kelly Johnson