4 ms·
I think that anything that OOP models well could be modelled even better with interfaces/traits, especially in flexible languages such as Go. To me, OOP is mai
by tomp 14y ago
I think that anything that OOP models well could be modelled even better with interfaces/traits, especially in flexible languages such as Go.
To me, OOP is mainly useful for implementation inheritance (in the rare cases where it's really needed). A very nice example is Python - it allows, but doesn't force you to use objects. I only use objects for encapsulation (e.g. make a new random number generator that is "independent" from the application's main RNG), and I don't recall ever using inheritance (in Python).