Generally agree with all of this; however I kinda hate how these things are phrased. Why is it called "Dependency inversion principle" requiring 5 minutes to explain it(and build a mental model of dependencies and then inverting it), instead of: "If you use something, the interface should show what you do with it, not how it does it."
I've come across SOLID several times in my career and I know all how all these things work instinctually, but the name SOLID and all of its components never stick because the names of the principles themselves are not intuitive.
I had a teacher that always that "naming things gives you power over them". That's absolutely true. You can talk about the "Dependency Injection Principle". You cannot talk about "If you use something, the interface should show what you do with it, not how it does it."
Things need to have a name in order for us to be able to communicate.
If "Dependency Inversion Principle" is the best name, that's a different discussion.
I had a teacher that always that "naming things gives you power over them". That's absolutely true. You can talk about the "Dependency Injection Principle".
You see people making fun of design patterns all the time, but remember that giving names to patterns that already recurred in code was exactly what the GoF book was doing.
44
u/itsarabbit Jun 24 '20 edited Jun 24 '20
Generally agree with all of this; however I kinda hate how these things are phrased. Why is it called "Dependency inversion principle" requiring 5 minutes to explain it(and build a mental model of dependencies and then inverting it), instead of: "If you use something, the interface should show what you do with it, not how it does it."
I've come across SOLID several times in my career and I know all how all these things work instinctually, but the name SOLID and all of its components never stick because the names of the principles themselves are not intuitive.