There are two main problems with Java-style interfaces in CoffeeScript:
- Every class in Java can have only one parent but implement as many interfaces as you like. CoffeeScript classes can extend only one class. That's it. If CoffeeScript allowed multiple inheritance everything would be as easy as I said before. However, it doesn't.
- Every class in Java is instance of all the interfaces it implements. In CoffeeScript
instanceofoperator returntrueonly for classes in objects' prototype chain. No exclusions, no possibility to override.