I learned JavaScript over 12 years ago and revitalized my skills in the dawn of the frameworks. I learned through necessity, when I had a project that required me to use it. The process of trial and error and applying what I already knew to make it work. Later, I was fortunate enough to have a single professor who made it all come together for me and confirmed what I thought I knew.
This week I have been tasked to “teach old dogs new tricks.” Basically, I need to take developers from other disciplines and put together or provide training materials for them to learn how to develop client-side applications using JavaScript and the Dojo Toolkit. I need to sum up what I learned over the span of a decade.
I’ve always believed that the best way to learn is time and practical experience. Seems I have neither of these things to work with here!
How did you learn JavaScript? What resources did you find the most helpful? Did you come from another discipline or primary skillset?
For seasoned developers, anything by Douglas Crockford is a good way to teach them the subtleties of JavaScript. He has one book on the cheap side called “JavaScript: The Good Parts” which I’ve come to love even as a “relative JS expert.”
Starting with an asynchronous framework like jQuery (doing simple event listeners) is a great way to start off I think as well.
Of course I learned through years of painful mistakes, so that’s another way to go 😉
I learned by watching you!
Haha – I learned through practical application, and by taking existing JavaScript code and rewriting it – which I found is particularly helpful if you have someone who is familiar with one framework language and need them to write it in another language – translating a familiar piece of code helps you know what *should* be done, and helps get you acquainted with the new API docs of the other framework application.
I found APIs and (in the case of Dojo) user forums to be incredibly helpful – but that was a couple years ago, and I hear their community has grown even more. Twitter can also be useful since there are several Dojo accounts.
David Walsh also has a few articles discussing Dojo (and I think a few that has the code written for three frameworks – jQuery, Dojo and MooTools).
This is actually a pretty hard one. I think more importantly, you have to get the developer in the right frame of mind, accepting how javascript works before they can really move forward.
For example, many traditional developers are intimidated by the timeline in flash, and so opt for flex instead. It’s a fine choice, but there are some things that are just done better in flash. So, I’ve found myself needing to relate what another developer is used to doing over the timeline. It’s usually a quick explanation that the loop exists in the flash player, so flex makes use of it too, and that the timeline is simply a way to change the properties of an object over time.
Regarding javascript, you’ll probably need to take everyone you’re teaching and relate it to their particular area of expertise. It sounds pretty cliche, but you’ll probably have to build bridges to ease people into it. If you’re working with a traditional java developer, something like, “Ok, javascript doesn’t have classes, but this is how I organize my code so it makes the most sense to me later when I come back to it.”
Celenza stole my recommendation! I highly recommend Crockford’s “JavaScript: The Good Parts” particularly because it covers both how and how NOT to use JavaScript. Crockford is an industry veteran (got his start in the 70s) and has a deep understanding of many languages. I think this comes across in the book and makes it particularly well suited to folks coming from other languages.
A fun interactive way to get folks to lean the basics (and quirks) of JavaScript is to have them run through the gamified, real-time exercises on http://www.codeacademy.com.
I think Robert is onto something. I don’t think teaching your audience the syntax and mechanics of the JavaScript language will be hard. What’s going to be hard is if you have to teach programmers with no event-driven GUI programming experience how to write even-driven GUIs. That is a huge shift because it requires understanding idoms and especially architectural patterns that they won’t be familiar with.
I am embarrassed that I have never read “JavaScript: The Good Parts”. I have seen numerous people talk about this book and I have also seen Kris post about it at one point. This book has given me a different perspective and has definitely changed my approach for discussing this with my team. Thanks for the feedback!