YAGNI原则

YAGNI stands for "you aren't gonna need it": don't implement something until it is necessary.

YAGNI意味着你没必要那么着急,不要给你定义的类实现太过于早的功能,你只需要先实现好现在需要的功能点.

Why
Any work that's only used for a feature that's needed tomorrow, means losing effort from features that need to be done for the current iteration.
对于以后才有用的需求,现在进行的一切工作,都意味着会失去对当前需要完成的需求的精力.
It leads to code bloat; the software becomes larger and more complicated.
否则,将会导致代码冗余,软件会变的更加庞大和复杂.
How
Always implement things when you actually need them, never when you just foresee that you need them.
通常当你,真正需要某个功能点的时候,你再去实现那个功能点,千万不能去实现那些你认为以后有可能会用的到的功能

你可能感兴趣的:(YAGNI原则)