编程法则 - DRY(Don't Repeat Yourself)

1,Don't Repeat Yourself

''Every piece of knowledge must have a single, unambiguous, authoritative representation within a system"

2.Once and Only Once

"Once and Only Once is much easier to apply as you write code than after the fact. It is very difficult to tease together two similar functions"

If you keep this principle in mind as you code it will help you keep your code supple and useful so it may live long and prosper

1.别自我重复

"每一部分知识必须唯一,明确,可靠的表现在一个系统里"

2. 一次且仅一次

"在编写代码时应用 一次且仅一次原则 比实施后容易的多,整合两个类似的函数是相当困难的!"

如 果你在编写代码的时候坚持这个原则,他将帮助你的代灵活而有用,而你的代码也会存活的长久兴旺!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值