From: phlip Date: 2008-07-14T20:35:36+09:00 Subject: Re: Why Ruby interpreter is writed in c (not in c++)? Ron Fox wrote: > Close but not really. The primary purpose of OO is that it provide a > higher level of abstraction than C does. One that can get closer to the > problem being solved than C does in natural use. > > This >can< result in less code, but the main win is that it results in a > better mapping of the program to the problem, and a better understanding > of the program by the programmers. You describe an "Object Based" system. The main win of an OOP is virtual methods have language support, reducing the odds of a misfire when you override a method. The alternative is messy function pointers that might point to garbage, or NULL. Overriding methods, in turn, allow old code to call new code, so you can easily change a program by adding to its lists of concrete classes, while leaving the abstract classes alone. The "Open Closed Principle". This benefit makes code harder to read and understand, not easier. -- Phlip