DEV Community

M Bellucci
M Bellucci

Posted on

Depend on things that change less often than you

What that actually means?
I would like to get concrete examples.

Top comments (5)

Collapse
 
ben profile image
Ben Halpern • Edited

My OOP education is only semi-formal, so I could be totally offbase, but I'll say what I intuit this could mean:

Your code might change often, but your dependencies should be pretty stable in this regard.

dev.to changes many times per day. Our main dependency Ruby on Rails changes a couple times a year. dev.to has no code dependents at the moment and if they did, they'd have to deal with a lot of bullshit from our changes.

Internal changes that don't modify the API should be fine vs changes that affect the interface you're coding against.

In OOP land, that same principle would make sense. The qualities of Human probably change less than the qualities of Programmer. And therefore, inheriting from Human seems more sensible.


I may be totally interpreting this in a way that is totally offbase, someone correct me if I'm way off here.

Collapse
 
delbetu profile image
M Bellucci

@ben why do you say that dev.to has no code dependencies?
Do you mean that dev.to knows only the API of rails, and thus when rails changes internally but keep the API it doesn't affect dev.to?
So the phrase could be trust the API not the implementation

Make sense for me,, but I thought this was related to inheritance maybe I'm wrong.

Collapse
 
ben profile image
Ben Halpern

Whoops sorry I meant to say dependents. Nobody is relating on our code via an API at this moment. Wrong word, I just fixed it.

Collapse
 
onecuteliz profile image
Elizabeth Jenerson

You’ve got it Ben.

Sandi Metz (and I’m sure others) speak on this concept. Seek out YouTube vids or her books for more explanation on the topic.

Collapse
 
delbetu profile image
M Bellucci

@elizabet Jenerson do you know which talk from Sandi?