设计原则

本文介绍了软件开发中的三个重要原则:YAGNI(You ain't gonna need it),鼓励程序员只在真正需要时才增加功能;DRY(Don't repeat yourself),旨在减少重复信息并确保每条信息唯一且权威的表示;KISS(Keep it simple, stupid),提倡简单直接的设计理念。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Just YAGNI, DRY and KISS for everything.

 

YAGNI - You ain't gonna need it

YAGNI is the principle in extreme programming that programmers should not add functionality until it is necessary. Ron Jefries writes, "Always implement things when you actually need them, never when you just foresee that you need them."

 

DRY - Don't repeat yourself

In software engineering, Don't Repeat Yourself or Duplication is Evil is a principle of software development aimed at reducing repetition of information of all kinds, especially useful in multi-tier architectures. The DRY principle is stated as "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system." The principle has been formulated by Andy Hunt and Dave Thomas in their book The Pragmatic Programmer. You can use refactor to remove duplication.

KISS - Keep it simple stupid  by Kelly Johnson

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值