
Why Go’s structs are superior to class-based inheritance - simplyianm
https://medium.com/@simplyianm/why-gos-structs-are-superior-to-class-based-inheritance-b661ba897c67#.568w38dkm
======
hcarvalhoalves
Also look at Clojure's protocols:
[http://clojure.org/reference/protocols](http://clojure.org/reference/protocols)

The "objects" you pass around are just data structures (maps) and protocols
only purpose is enforce you call legal functions on those, but without mixing
the two concepts (like Python/Ruby, where each instance is a data structure
that contains both private properties and pointers to method objects, and can
even modify those on-the-fly). If you want to extend at 3rd party interface at
runtime you still can, but it's at the protocol level rather than instance
level - better than monkeypatching.

Also, works better to implement the Component-Entity-System pattern on dynamic
languages, because your objects are simpler data structures, without all the
memory overhead.

I believe this (defining interfaces and passing data structures around) is "OO
done right" \- OO is a powerful idea but it seems we're only now figuring out
how to implement it.

~~~
empthought
If by "only now" you mean 1979 or so. Flavors and CLOS have been things for
quite some time now.

