3 ms·
Not to detract from your point of vastly different things, but you picked a bad example. You add a method to the prototype: File::close = -> Et voilà, all
by Ezku 15y ago
Not to detract from your point of vastly different things, but you picked a bad example. You add a method to the prototype:
File::close = ->
Et voilà, all Files are closeable.
- phoboslab 15y agoNice, I didn't know that CoffeeScript has a shorthand for .prototype. So, to revise my point: with "proper" classes (i.e. Java or C++) this wouldn't be possible, or at least more complicated and not the way to do things. Classes are not the ultimate solution and it's a good thing that Go tries a different approach to OOP.