5 ms·
I appreciate the post, but the typical reaction to these articles seems to be: - JavaScript looks a bit like (Java/Ruby/other language) - JavaScript does not
by EzGraphs 14y ago
I appreciate the post, but the typical reaction to these articles seems to be:
- JavaScript looks a bit like (Java/Ruby/other language)
- JavaScript does not work like (said language)
- JavaScript sucks
Granted, I appreciate folks pointing out the "bad parts" of the language and the strange gotchas. And JavaScript has more than its share of bad parts. But it also requires a change in mindset. At minimum, expect
- a priority of first-class functions,
- Prototypal rather than classical inheritance,
- time spent learning JavaScript syntax itself instead of constructs from other languages (which often will work, but not in the way expected).
Books that have given me a renewed appreciation are Douglas Crockford's book (JavaScript the Good Parts) and John Resig's "Secrets of the JavaScript Ninja."
- masklinn 14y ago> - Prototypal rather than classical inheritance, Meh. Javascript looks, feels and behaves much more like a single-inheritance class-based language (without the class sugar) than like a prototype-based one (Io and even more so Self). Especially if you stick to the standard. A small concession was made towards prototypal use in ES5 with Object.create (which remains little used and slow as molasses) but it's looking to snap back to classes with ES6
- jarek-foksa 14y agoES6 will introduce class syntax, but it's also going to standardise __proto__ property [1] making it easier to write both classical and prototypical code. [1] http://javascript.spec.whatwg.org/#object.prototype.__proto__ http://javascript.spec.whatwg.org/#object.prototype.__proto_...