cln.co/
YAGNI
YAGNIYou Aint Gonna Need It

"You should not introduce things in order to solve a future problem that you don’t have right now." - Ron Jeffries

Key Takeaways
  • Only code what you need right now.
  • Adding extra features "just in case" wastes time.
  • Keeping code simple makes it easier to change later.

Example

1public class User {  
2    private String name;  
3    private int age;  
4
5    // YAGNI violation: A method to calculate the user's retirement age,  
6    // which is not currently necessary for the User class.  
7    public int calculateRetirementAge() {  
8        return 65 - this.age;  
9    }  
10}

Description

Keep things simple and avoid investing time and effort in building features based on assumptions about what the future might hold.

YAGNI is like a friendly warning against filling your backpack with too many "just in case" items for a hike; it only weighs you down.

This approach aligns with Agile methodologies, which emphasize iterative development, responding to changes, and streamlining work to what's currently valuable.

You might also like:
ADP
APO
BSR
CCP
CoI
CQS
CRP
DIP
DRY
EUHM
EWV
FF
FTSE
GRASP
HC
HLYW
IH
IoC
IOSP
ISP
KISS
LC
LoD
LOLA
LSP
OCP
POLP
POLS
PoMO
REP
RoT
RTFM
SAP
SDB
SDP
SLA
SoC
SOLDIER
SOLID
SPOT
SRP
TdA
WET
YAGNI
ZOI