Hey all, this is my first post the HN, but I was curious if any of you had some resources that would be useful to an individual hoping to learn some more advanced javascript. I've already mastered the basics (control flow, loops, dom manipulation, etc) and use javascript and jquery quite a bit in my day job for prototyping and data transformations (etl sw w/ js scripting), but I often hear developers talking about the <i>right</i> way of doing things and I was curious as what some resources might be for a aspiring developer who doesn't have an engineering background. I also have some experience with php, python, mysql so I am not completely technically illiterate but I still feel like there is a large jump that needs to be made before I would consider myself a full fledged developer.<p>Any advice or resources would be greatly appreciated.
'JavaScript: The Good Parts' by Douglas Crockford is a great place to start[1].<p><pre><code> This authoritative book scrapes away these bad features
to reveal a subset of JavaScript that's more reliable,
readable, and maintainable than the language as a
whole-a subset you can use to create truly extensible
and efficient code.
</code></pre>
The other thing that has had a huge impact on my coding style is learning to write tests for everything with Jasmine[2]. Forcing myself to write tests has basically forced me into better design practices, since it's nigh-on impossible to test javascript callback-spaghetti.<p>Doing a couple of backbone.js[3] tutorials may be a bit of an eye-opener too.<p>[1] <a href="http://shop.oreilly.com/product/9780596517748.do" rel="nofollow">http://shop.oreilly.com/product/9780596517748.do</a><p>[2] <a href="http://pivotal.github.com/jasmine/" rel="nofollow">http://pivotal.github.com/jasmine/</a><p>[3] <a href="http://backbonejs.org/" rel="nofollow">http://backbonejs.org/</a>
JavaScript: The Good Parts is definitely a good book for what you want. But there are more:<p>* JavaScript Patterns by Stoyan Stefanov<p>* Learning JavaScript Design Patterns - Addy Osmani<p>* High Performance JavaScript - Nicholas Zakas<p>After you read these three books you might become apt to write great, efficient JS code and know the underpinnings of the language, which IMO has a particularly curious design and might make you confused sometimes.<p>P.S: Check out the WTFJS website for being introduced to some strange behaviour of the language <a href="http://wtfjs.com/" rel="nofollow">http://wtfjs.com/</a><p>Have a nice and busy week!
Grab a cup of coffee, and read the source of these libs till you know what's going on:<p>underscore - <a href="http://underscorejs.org/" rel="nofollow">http://underscorejs.org/</a>
backbone - <a href="http://backbonejs.org/" rel="nofollow">http://backbonejs.org/</a>
dojo - <a href="http://dojotoolkit.org/" rel="nofollow">http://dojotoolkit.org/</a><p>They all have great comments in the dev versions and the code is very well written IMO. If you really want to become an advanced js programmer I think reading and understanding source code is basically the only way to go.<p>good luck :)
As recurser mentioned, backbone.js tutorials might be a good idea. I'd also recommend reading the source of backbone.js to see how it works internally. It's around 1500 lines of well written and fully commented javascript, and will probably cover everything you're hoping to learn in a very concise and practical way.
There was multiple discussions here on HN where you might find some answers. The most recent I found being: <a href="http://news.ycombinator.com/item?id=4673106" rel="nofollow">http://news.ycombinator.com/item?id=4673106</a>