4 ms·
"JS has callable attributes, Hobjects are unusable for stable keys...object does not carry any type information, Null everywhere, since ojects are hashes" I fi
by z92 13y ago
"JS has callable attributes, Hobjects are unusable for stable keys...object does not carry any type information, Null everywhere, since ojects are hashes"
I find most of the problems listed are related with dynamic type system of JS. These all can be solved most easily by a statically typed language.
Therefore the debate mostly is between static vs dynamic typing.
- nness 13y agoI would also argue that expecting an object to carry type information is an unfair expectation of a non-object-orientated language.
- gnaritas 13y agoJavaScript is an objected oriented language.
- Fr0styMatt 13y agoNot really, from what I gather it's closer to a functional language that lets you implement objects with private data by using closures.
- gnaritas 13y agoYes really. It's an OO language based on Self's prototypical OO model rather than a class based OO model. Prototypical OO is still OO, unless you're claiming Self isn't OO, but the Smalltalker's who invented Self would very much disagree. Prototypes are objects, no closures or classes required.
- Fr0styMatt 13y agoAh, I stand corrected, thanks. Makes sense; I think I had something about private vars in JavaScript and closures running through my head and confused it with 'JavaScript does OO with closures' :)
- gnaritas 13y agoNo problem. People who don't like or get prototypes have certainly reimplemented classes with closures, but classes are not a requirement to be OO, objects are; classes are just one way to do it, prototypes are another. Objects don't require classes, though many a JavaScript programmer thinks so.
- Fr0styMatt 13y agoFWIW by the way, I don't get all the JavaScript hate either, other than perhaps it's from people who erroneously think they don't have any choice except to use JavaScript on the client side. From what I've seen of JS as a language, I actually quite like it, but haven't used it for anything substantial. I do like what we seem to be arriving at with asm.js; a subset of JS as the assembly language of the web, with people being able to choose the language that best fits their problem domain and target the JS machine.
- peq 13y agoIt is more about weak typing vs strong typing. Clojure has dynamic but stronger typing and it has less of these problems.