News for hackers. Stuff that matters.
Re:Comparing JavaScript, CoffeeScript & ClojureScript by Tuna-Fish on Thursday January 26, 2012 @07:38PM (#3516693)
>> We've extended all objects including numbers to respond to the bar function.We can provide more specific implementations at anytime, i.e. by using extend-type on string, array, Vector, even your custom types

>Mimicking that in javascript:

>This is totally safe (except for oldIE)

No, not in his definition of safe it isn't. That's just monkeypatching -- the new functions are visible everywhere in the program, and it's entirely possible to be stung badly by name collisions. The ClojureScript version doesn't have these problems -- the protocol only exists in the namespaces where it is defined or imported.

There are no comments on this comment yet.