DEV Community

Cover image for A blog on DRY and SOLID principle in development
Joel
Joel

Posted on

A blog on DRY and SOLID principle in development

Welcome to a detailed blog about Dry and solid principle in development, join me as we learn together 💪

To move further, let's define the key words contextually;

_Dry:_Maintaining temperance, void or abstinent from water, in any state.
_Solid:_Lacking holes or hollows, strong or unyielding.
_Principle:_Rule used to choose among solutions to a problem.
_Development:_The process of growth, direct change.

Going on;
Don't repeat yourself" (DRY) is a principle of software development aimed at reducing repetition of information which is likely to change, replacing it with abstractions that are less likely to change, or using data normalization which avoids redundancy in the first place.

The DRY(Don't repeat yourself) principle is stated as "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system"

When the DRY principle is applied successfully, a modification of any single element of a system does not require a change in other logically unrelated elements. Additionally, elements that are logically related all change predictably and uniformly, and are thus kept in sync.

Example of DRY PRINCIPLE;
writing a function that contains a specific logic and then calling it multiple times in our code is a form of applying the DRY principle. We can see that, after applying DRY, the logic that converts Fahrenheit to Celsius appears only once in our code.

SOLID principles are object-oriented design concepts relevant to software development. SOLID is an acronym for five other class-design principles: Single Responsibility Principle, Open-Closed Principle, Liskov Substitution Principle, Interface Segregation Principle, and Dependency Inversion Principle.

Writing a code which satisfies present requirements, also which can satisfy future requirement easily, should be the goal of every developer.
Evolving with the time is the only factor which can keep you going, otherwise, you all know what happened with Nokia and Canon brand.

I believe this blog, has given you an insight as regards Dry and solid principle in development.

Thanks 🤝

Top comments (0)