cln.co/
DRY
DRYDon't Repeat Yourself

"Every piece of knowledge must have a single, unambiguous, authoritative representation within a system." - Andy Hunt and Dave Thomas

Key Takeaways
  • Reduce repetition in code.
  • Duplicate code equals more bugs to fix.
  • Less repeating, more peace of mind in coding.

Example

1public void Repeat() {
2    Console.WriteLine("I Will Not Repeat My Code");
3    Console.WriteLine("I Will Not Repeat My Code");
4    Console.WriteLine("I Will Not Repeat My Code");
5    Console.WriteLine("I Will Not Repeat My Code");
6    Console.WriteLine("I Will Not Repeat My Code");
7    Console.WriteLine("I Will Not Repeat My Code");
8    Console.WriteLine("I Will Not Repeat My Code");
9}

Description

Instead of spreading identical code around, make a single, reliable piece that you can use everywhere. This keeps your code tidy, makes it easier to maintain, and saves you from the headache of tracking down copy-paste bugs. It's a real game-changer for staying organized and efficient.

It's tempting to copy and paste code—it's quick and easy, right? But this shortcut can lead to a big mess.

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