3 ms·
> It takes some practice, but once you get it your code grows so much better. It's true. I had a bit of a roundabout journey to getting this idea. Studying CS
by pseudoramble 8y ago
> It takes some practice, but once you get it your code grows so much better.
It's true. I had a bit of a roundabout journey to getting this idea.
Studying CS, I learned a ton about implementation inheritance, and only a bit about composition - enough to sort of answer a question about it, but not really get the feeling. So overall I didn't use it much.
When I started working, I saw implementation inheritance used a ton and got the impression that it really made things way too complex. There was more to the complexity than just this of course (design patterns everywhere, convoluted abstractions, strange monolith tools, etc) but it didn't help.
Later I started learning about FP, where composition is just second nature, and frankly one of the main methods of abstraction you get. So learning how to compose things came from functions.
Over the past few months I've come back to more OOP, and I've been using composition a whole lot more. And it does make a huge difference, and I don't think I've used any sort of inheritance for my own code at all at this point.
So yeah, I agree and it is a journey.
- asimpletune 8y agoI love that description of your evolution and I’d say it was actually the same for me.