|
|
|
|
|
by jashkenas
5464 days ago
|
|
Quick point of clarification. The post says: > As it turns out that isn’t entirely true since coffeescript
> is a class based object oriented language and javascript is
> prototype based. This was actually a mark against
> coffeescript for me since part of my desire to learn
> javascript was to dally in prototype based OOP.
CoffeeScript is prototype based to the precise same extent that JavaScript is. The "class" keyword is just sugar for JavaScript's constructor function + prototype chain combination. To mangle Shakespeare:What's in a name? That which we call a class by any other name would smell as sweet. Call it a prototype if you like -- it's the same thing in code. |
|
I am still a student of computer science and in my university's Java encapsulated worldview they've not discussed the finer points of non class-based OOP. I will do more research on the subject.