SOLID Principles in JavaScript: What Does the 'L' Stand For? | HackerNoon

Norge Nyheter Nyheter

SOLID Principles in JavaScript: What Does the 'L' Stand For? | HackerNoon
Norge Siste Nytt,Norge Overskrifter
  • 📰 hackernoon
  • ⏱ Reading Time:
  • 31 sec. here
  • 2 min. at publisher
  • 📊 Quality Score:
  • News: 16%
  • Publisher: 51%

'SOLID Principles in JavaScript: What Does the 'L' Stand For?' solid javascript

setWidth, getArea

In our example, Rectangle and Square are different objects, that contain a little bit similar logic, but at the same time different logic. So, it will be more correct to divide them and not to use them as a "Parent-Child" class. And now, Liskov Substitution Principle says, that if we want to change from base class to subclass, the system should work, as it was before:

But now, we have a problem, our fly method doesn't expect error inside it and the "fly" function was created only for that birds, who can fly. Penguins can't fly, so we break Liskov Substitution Principle.

Vi har oppsummert denne nyheten slik at du kan lese den raskt. Er du interessert i nyhetene kan du lese hele teksten her. Les mer:

hackernoon /  🏆 532. in US

Norge Siste Nytt, Norge Overskrifter

Similar News:Du kan også lese nyheter som ligner på denne som vi har samlet inn fra andre nyhetskilder.

Tiny Switches Give Solid-State LiDAR Record ResolutionTiny Switches Give Solid-State LiDAR Record Resolution(LiDAR) system, which worked like light-based radar. Together with cameras and radar, LiDAR mapped the environment.
Les mer »

GBP/JPY Price Analysis: Faces solid resistance around 154.60, braces to the 154.10sGBP/JPY Price Analysis: Faces solid resistance around 154.60, braces to the 154.10sGBP/JPY extends its rally to three straight days, thus negating the double-top chart pattern, as the cross-currency pair turns bullish on a positive U
Les mer »

Stolen, sold, not even solid gold. The story of OscarStolen, sold, not even solid gold. The story of OscarThe most famous statue in the world is probably, maybe the Oscar. Many have been stolen, and several have been sold.
Les mer »

What It Feels Like to Close Two Marketing Campaigns on the Same Day | HackerNoonWhat It Feels Like to Close Two Marketing Campaigns on the Same Day | HackerNoonLook, I may be a little biased, but I think HackerNoon has one of the best selections of humans working for them in the whole world (literally, we're remote).
Les mer »

A Real Life Example of CI/CD Pipelines in Action | HackerNoonA Real Life Example of CI/CD Pipelines in Action | HackerNoon'A Real Life Example of CI/CD Pipelines' by GhaniHere devop devops
Les mer »



Render Time: 2025-03-11 21:30:48