4 ms·
"Car/Animal extends..." slowed my ability to comprehend OOP significantly when I was learning to code. It just did not make any sense to me and I felt like an i
by system16 4y ago
"Car/Animal extends..." slowed my ability to comprehend OOP significantly when I was learning to code. It just did not make any sense to me and I felt like an idiot for not being able to equate these "real-world" examples to the code I was trying to write. I just could not make the connection.
It wasn't until I started trying to make a simple video game that these concepts made sense: an "Enemy" class could have properties of health and speed that a "Boss" or "Minion" could inherit from, etc.
- redisman 4y agoEven in games composition is much better and what pretty much every engine forces you to use these days. It’s a lot more flexible too as you can compose a new boss out of ten different components rather than having to refactor a crazy tree of nonsense