On 16/11/2009, frederic <fduboi...@gmail.com> wrote: >> Go has no inheritance, and that is >> basically the root of all OO evil (and inheritance is in mainstream >> programming considered the defining characteristic of any OO >> language.) >> > > Why do you think inheritance is the root of all evil? > > That's an important issue, given that Go offers " ways to embed types > in other types to provide something analogous—but not identical—to > subclassing" > [from "Effective Go"]
Infact not really like sub-classing at all. Embeding is putting structs inside other structs and has nothing to do with the methods associated with those structs. It's almost exactly like you'd do it in C except a bit nicer. The problem with inheritance has nothing to do with the data structures and everything to do with the methods. - Jessta -- ===================== http://jessta.id.au