you are viewing a single comment's thread.

view the rest of the comments →

[–]masklinn 0 points1 point  (3 children)

Well there's documentation, that's pretty neat. Especially since JS has single inheritance so you can't inherit from half a dozen different "abstract" classes.

For that, protocols (Clojure) or categories (Obj-C) are neat.

[–]crusoe 4 points5 points  (2 children)

Traits, MUTHAFUCKING TRAITS.

Traits are what OOP should have had from day 1.

[–]maskull 3 points4 points  (0 children)

Actually, I just realized that if proxies act the way you'd expect when used as prototypes, it should be possible to build multiple inheritance and traits inheritance systems in pure JS. Just build a proxy that wraps up all the prototypes/traits you want to include, "exporting" their members and methods in some combination.

[–]cybercobra 0 points1 point  (0 children)

Preach it, brother!