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. 一次且仅一次
"在编写代码时应用 一次且仅一次原则 比实施后容易的多,整合两个类似的函数是相当困难的!"
如 果你在编写代码的时候坚持这个原则,他将帮助你的代灵活而有用,而你的代码也会存活的长久兴旺!
本文介绍了软件开发中的两条重要原则:别自我重复(DRY)与一次且仅一次(OOO)。DRY原则强调知识的唯一、明确及权威的表现形式;OOO原则提倡在编写代码时避免重复工作,保持代码简洁高效。遵循这两条原则有助于提升代码质量,让其更加灵活和易于维护。
1400

被折叠的 条评论
为什么被折叠?



