The DRY principle recommends not to repeat the same solution.
This applies to repeat this code, how to solve it, and what to do. Repetitive actions can be automated, repetitive code can be extracted and referenced, repetitive patterns can be generalized. The advantage of using the DRY principle is that you avoid mistakes and save time:
- The error in the code copied in many places needs to be corrected everywhere.
- When performing a task manually, it’s easy to make a mistake. The automatic script will not make a mistake with subsequent performances and does the work for us.
All posts from mini project: Learn SOLID and OOP principles:
- SOLID
- SOLID exercises
- S like Single responsibility principle
- SOLID exercises — Kata
- O as Open-closed principle
- L jak Liskov Substitution Principle
- Interface segregation principle
- KISS — Keep it simple, stupid
- DRY — Don’t repeat yourself
- Dependency inversion principle
- SLAP — Single Level of Abstraction Principle
- Composition Over Inheritance
- Encapsulate what changes
- Lod — Law of Demeter
- ES as Exercises of Single responsibility principle
- EO as Exercises of Open/closed principle
- EL as Exercises of Liskov Substitution Principle
- EI as Eexrcises of Interface segregation principle
- ES as Exercises of Dependency Inversion Principle
- Object-oriented programming
- OOP — Object-Oriented Programming — Advice
- OOP — Object Oriented Programming
Sources
Main image
Materials
- https://pl.wikipedia.org/wiki/DRY
- https://en.wikipedia.org/wiki/Don%27t_repeat_yourself
- http://kurs.aspnetmvc.pl/Wzorce/DRY
- https://deviq.com/don-t-repeat-yourself/
Sorry, there was a YouTube error.
Remarkable! Its truly remarkable piece of writing, I have got much clear idea on the topic of from this paragraph.
Thank you!