I Used to be a πŸ’© Coder πŸ’» Until I Discovered SOLID Principles 🌟

I remember when I first heard about SOLID principles, I thought to myself “what a load of πŸ’©, who needs that many rules to write good code?” πŸ€” Little did I know, it was my code that was πŸ’©. Eventually, those principles became the cornerstone of my develo…


This content originally appeared on DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» and was authored by Yashodhan Singh Rathore

I remember when I first heard about SOLID principles, I thought to myself "what a load of πŸ’©, who needs that many rules to write good code?" πŸ€” Little did I know, it was my code that was πŸ’©. Eventually, those principles became the cornerstone of my development practice and elevated my coding skills tenfold πŸš€.

It wasn't until my CTO πŸ§” started making "amazing" remarks in code review and explained the value of SOLID principles that I really understood their importance. He showed me how they made my code more maintainable, scalable and easier to understand. And trust me, that's when I really started to see the value in SOLID.

Here's how each SOLID principle leveled up my skills:

Single Responsibility Principle (SRP) πŸ’Ό
This principle taught me to write code that only has one responsibility, making it much easier to maintain and understand. It's like having a neat and organized workspace, everything has its place and it's much easier to find what you need!

Open/Closed Principle (OCP) πŸšͺ
This principle taught me to write code that can be easily extended, but not modified. It's like having a building that can be added on to, but still remains sturdy and secure.

Liskov Substitution Principle (LSP) πŸ”—
This principle taught me to write code that is easily interchangeable, like building with LEGOs! It's like being able to switch out parts without affecting the overall structure.

Interface Segregation Principle (ISP) 🌐
This principle taught me to write code that is flexible, allowing me to create interfaces that can be used by different parts of my code without affecting the others. It's like having multiple languages that can communicate with each other!

Dependency Inversion Principle (DIP) πŸ’ͺ
And my personal favourite, DIP taught me to write code that is easily adaptable, by depending on abstractions instead of concrete implementations. It's like having a toolbox that can be used for any job, no matter how complex!

In conclusion, SOLID principles may seem overwhelming at first, but they're worth taking the time to understand. Trust me, your code will thank you! 😊

P.S. πŸ“’ Don't stress about memorizing each principle, even I had to Google them to write this article! But in practice, they've already become second nature to me, like muscle memory πŸ’ͺ. Just keep using SOLID principles in your development and you'll see the benefits for yourself! πŸ’»

Image description

Image description


This content originally appeared on DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» and was authored by Yashodhan Singh Rathore


Print Share Comment Cite Upload Translate Updates
APA

Yashodhan Singh Rathore | Sciencx (2023-02-15T00:51:57+00:00) I Used to be a πŸ’© Coder πŸ’» Until I Discovered SOLID Principles 🌟. Retrieved from https://www.scien.cx/2023/02/15/i-used-to-be-a-%f0%9f%92%a9-coder-%f0%9f%92%bb-until-i-discovered-solid-principles-%f0%9f%8c%9f/

MLA
" » I Used to be a πŸ’© Coder πŸ’» Until I Discovered SOLID Principles 🌟." Yashodhan Singh Rathore | Sciencx - Wednesday February 15, 2023, https://www.scien.cx/2023/02/15/i-used-to-be-a-%f0%9f%92%a9-coder-%f0%9f%92%bb-until-i-discovered-solid-principles-%f0%9f%8c%9f/
HARVARD
Yashodhan Singh Rathore | Sciencx Wednesday February 15, 2023 » I Used to be a πŸ’© Coder πŸ’» Until I Discovered SOLID Principles 🌟., viewed ,<https://www.scien.cx/2023/02/15/i-used-to-be-a-%f0%9f%92%a9-coder-%f0%9f%92%bb-until-i-discovered-solid-principles-%f0%9f%8c%9f/>
VANCOUVER
Yashodhan Singh Rathore | Sciencx - » I Used to be a πŸ’© Coder πŸ’» Until I Discovered SOLID Principles 🌟. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2023/02/15/i-used-to-be-a-%f0%9f%92%a9-coder-%f0%9f%92%bb-until-i-discovered-solid-principles-%f0%9f%8c%9f/
CHICAGO
" » I Used to be a πŸ’© Coder πŸ’» Until I Discovered SOLID Principles 🌟." Yashodhan Singh Rathore | Sciencx - Accessed . https://www.scien.cx/2023/02/15/i-used-to-be-a-%f0%9f%92%a9-coder-%f0%9f%92%bb-until-i-discovered-solid-principles-%f0%9f%8c%9f/
IEEE
" » I Used to be a πŸ’© Coder πŸ’» Until I Discovered SOLID Principles 🌟." Yashodhan Singh Rathore | Sciencx [Online]. Available: https://www.scien.cx/2023/02/15/i-used-to-be-a-%f0%9f%92%a9-coder-%f0%9f%92%bb-until-i-discovered-solid-principles-%f0%9f%8c%9f/. [Accessed: ]
rf:citation
» I Used to be a πŸ’© Coder πŸ’» Until I Discovered SOLID Principles 🌟 | Yashodhan Singh Rathore | Sciencx | https://www.scien.cx/2023/02/15/i-used-to-be-a-%f0%9f%92%a9-coder-%f0%9f%92%bb-until-i-discovered-solid-principles-%f0%9f%8c%9f/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.