Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Is there any advantage to using OO in a language that doesn't have classes or inheritance?

Yes. Really, interfaces are all you need for OO; class are just types-that-also-define-interfaces, and inheritance is just a shortcut for interface implementation.

While I think Go's implicit interface implementation is pretty much 180-degrees off the best way to do OO w/o classes and inheritance (I'd prefer explicit interface implementation, which eliminates interface collision), I do think clasess and inheritance get in the way more than they help.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: