V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
xoxo419

代码的抽象三原则

  •  
  •   xoxo419 · Feb 22, 2018 · 1596 views
    This topic created in 3000 days ago, the information mentioned may be changed or developed.

    "抽象化",就是指从具体问题中,提取出具有共性的模式,再使用通用的解决方法加以处理.

    三原则

    • DRY-Don't repeat yourself
    • YAGNI-You aren't gonna need it
    • Rule of three

    "三次原则"是 DRY 原则和 YAGNI 原则的折衷,是代码冗余和开发成本的平衡点,值得我们在"抽象化"时遵循

    代码的抽象三原则

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1281 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 17:24 · PVG 01:24 · LAX 10:24 · JFK 13:24
    ♥ Do have faith in what you're doing.