YAGNI stands for "you aren't gonna need it": don't implement something until it is necessary.
YAGNI意味著你沒必要那么著急,不要給你定義的類實現(xiàn)太過于早的功能,你只需要先實現(xiàn)好現(xiàn)在需要的功能點.
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.
對于以后才有用的需求,現(xiàn)在進行的一切工作,都意味著會失去對當(dāng)前需要完成的需求的精力.
It leads to code bloat; the software becomes larger and more complicated.
否則,將會導(dǎo)致代碼冗余,軟件會變的更加龐大和復(fù)雜.
How
Always implement things when you actually need them, never when you just foresee that you need them.
通常當(dāng)你,真正需要某個功能點的時候,你再去實現(xiàn)那個功能點,千萬不能去實現(xiàn)那些你認(rèn)為以后有可能會用的到的功能