From: Adriano Ferreira Date: 2005-02-11T01:05:08+09:00 Subject: Re: Class of the Instance [was Re: Building a Better Functor] Robert Klemme said: > JavaScript has no classes as far as I know. Ruby has classes and > from that alone it's obvious that it's a bit more complicated. Indeed JavaScript supports object orientation based on prototypes rather than classes. This is an idea borrowed by a Smalltalk-like language called Self and other sources of inspirations. Don't underestimate JavaScript though or prototype-based inheritance. Most things that can be done with classes can be done with prototypes. Some things are straightforward with prototypes: delegation, addition of a few methods or properties to one or a few instances. The obvious thing with JavaScript is that it lacks syntactic sugar to make prototype construction more legible and distinguishable. Most JavaScript code out there are lame and don't use object programming. But the real point is that writing object code in JavaScript can be pretty complicated and likely much less legible than in Ruby. Regards, Adriano.