From: John Carter Date: 2007-12-04T13:37:55+09:00 Subject: Re: What are the differences between c++ and Ruby? On Mon, 3 Dec 2007, Todd Benson wrote: > On Dec 2, 2007 7:40 PM, duddilla's wrote: >> Hi >> I would like implement multiple inheritance in java by using ruby >> mixin mechanism.Is that possible? And my other question is what are >> exact differences between C++ and Ruby? and Ruby and Java? >> >> Thanks > > You do understand, of course, that to answer these questions, one > might have to write an entire book. By asking these, you come > dangerously close to a RTFM response. Don't be so unhelpful... it's obvious that Ruby is like a writing desk and C++ is like a Raven. (Before you go ballistic... Read Alice in Wonderland and realize I'm pulling legs left right and center! :-)) C++ statically type, compiled. Ruby dynamically (duck typed) interpreted. C++ designed as an incremental improvement on C to improve code reuse whilst adding the minimum number of new keywords. (If you think about it, that's a really really lousy objective function.) Ruby designed as a best of all worlds (perl/smalltalk/....) new language. Java statically typed compile to interpreted byte code. C++ and Java are not "objects all the way down" Ruby is. C++ has multiple inheritance, Java has single inheritance but "extends" stateless interfaces. You can duplicate Javarish behaviour in C++ by inheritaing from stateless abstract class where all methods are "pure virtual". You can emulate Rubyish mixin behaviour in C++ by multiple inheritance from stateless classes. There is no easy root to emulate mixins in java.