92 points · by peregrine · 15y ago · 26 comments
C++, for example, has multiple inheritance, and I have used it to good effect. OTOH, if I needed to implement Dijkstra's Alg in C++, then I don't think it would even occur to me to inherit from both a priority queue and a directed graph base class. (And even now that it does occur to me, it doesn't seem to be a good idea.) Rather, I'd use something akin to the interfaces presented here. Of course, interfaces are not formalized in C++, but the C++ culture does include the notion of a concept, to be used with a template.
If the language were Python, I'd proceed similarly. And then there's Java, which doesn't even have multiple inheritance. I've never heard anyone claim that Java is somehow ill-suited for the implementation of graph algorithms (but maybe it is -- never thought about it).
Perhaps what this discussion is overturning, is not so much a multiple-inheritance mindset, as an Eiffel mindset. (But I don't know much Eiffel, so it's hard to say.) And the discussion also suggests that Go's formalization of interfaces can be a Good Thing.
https://groups.google.com/forum/?nomobile=true#!msg/golang-n...
Then, I discovered that to see more content, I had to swipe up with two fingers. There were no scroll indicators. This and the scaling problem ("you cannot rescale this web site. We have decided for you that this size is perfect. And no scrolling to see the words that run off the edge of the screen.") are...well, problems.
http://groups.google.com/group/golang-nuts/msg/7030eaf21d3a0...
Rather than inheriting from some base class, you just make sure your class can do certain operations and then other stuff works on that- it's good way to decouple algorithms, containers, etc. from the types they work with.
It would be nice to be able to specify tests that every implementor of the Heap interface must pass?
Given those circumstances, refrain from responding if you aren't going to be genuinely helpful.
Nobody likes a comment from the peanut gallery.
The reason I don't have a Google account is that I don't like being profiled and tracked as I go around the Internet and I believe that pay-walls should not be in front of free information.
A Google account is a pay-wall. You pay by providing them with some information about you.