C# 7 and .NET: Designing Modern Cross-platform Applications
by Mark J. Price, Ovais Mehboob Ahmed Khan
DRY (Don't Repeat Yourself)
DRY (Don't Repeat Yourself) is also one of the core principles of writing cleaner code. It addresses the challenges developers face in big applications when they are constantly changing or extending with respect to functionality or underlying logic. As per the principle, it states that "Every piece of knowledge must have a single dependable representation within the system."
When writing an application, we can use abstractions and avoid repetition of code to avoid redundancy. This benefits in accommodating changes and lets developers focus on one area where the change is required. If the same code is repeated in multiple areas, changes at one place need to be done in other places as well, and this eliminates good ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access