spider
spider copied to clipboard
ES6 Classes?
I think it makes sense to be close to ES6. Specially the common features should be consistent.
+1. The current class model is somewhat flawed in that it doesn't really use prototypes, so an actual class
keyword would be great.
@timdp It does use prototypes:
func Snake(name)
extends Animal(name) {
...
}
Snake.prototype.instanceMethod = func () {
super.instanceMethod();
};
@alongubkin That's what I thought, but the TimeMachine
example on the website doesn't work that way. Also, having to do the whole prototype
dance yourself is incredibly tedious, although that's what this issue is about.
Spider seems so far is a strict improvement of javascript. It makes sense to keep the good ideas of Javascript. And I would say that classes is a good feature of ES6. That is if we assume Classes of any kind are a good idea. I would be open to removing all class patterns from Spider as well, and never using 'new', prototype or any of that stuff. You know, like Crockford.