Discover and read the best of Twitter Threads about #solidprinciples

Most recents (2)

Do you want to write better, more maintainable, and more scalable code? Then you'll want to learn about the SOLID principles. In this thread, I'll be explaining each principle and why it's important for software development. Get ready to level up your coding skills! #javascript
The Single Responsibility Principle: A class should only have one reason to change. This promotes modularity and makes it easier to maintain and extend code.
The Open-Closed Principle: Software entities (classes, modules, etc.) should be open for extension but closed for modification. This helps prevent unexpected side effects from changes.
Read 7 tweets
📔 The "Interface Segregation Principle" (ISP) says:

"Clients should not be forced to depend on methods they do not use".

Some people believe that this does not apply to dynamically typed languages because they don't have interfaces.

But, it applies 👇 1/3

#SolidPrinciples
We can generalize the ISP as:

"Clients should not be forced to depend on things they do not need".

If you create unnecessary dependencies, you increase coupling and you will experience the problems of *too much knowledge*.

Examples 👇 2/3
❓ Have you ever been forced to:

🔹Instantiate a complex net of objects just to run a simple test?
🔹Call two irrelevant functions before the function that interests you?
🔹Pass data into a function that does not use it?

These problems may appear when you *know too much*.
3/3
Read 3 tweets

Related hashtags

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!