What is currently the best book for learning javascript?
Hi, I am looking at making Javascript my language to learn for 2011. What has worked in previous years (c#, Python, Haskell) is to book-learn for the first 6 months, and then find a way to use the language at work in the second 6 months.
I am picking Javascript because there is a cool javascript user group in my area, and there is a chance I may be able to use it at work.
I have heard of Javascript the Good Parts, is that recommended? I would prefer something modern, that has a good mix of the practical with some of the more out there possibilities, and ideally a mix of both in-browser javascript as well as non-browser javascript.
Thanks
Posted Nov 12, 2010, 2:09 PM UTC
For some reason people often answer "The Good Parts" as a recommendation for learning JavaScript. It seems to be a result of the unfortunate echo chamber in the JS community, where some people just mindlessly repeat whatever Douglas Crockford (or John Resig, etc etc) says.
I disagree with this...."The Good Parts" is a book every JS'er should read, no doubt...but it should be the SECOND book you read.
The Good Parts will give you a very good understanding of theory, but little practical knowledge. It covers very little DOM, browser issues, etc etc.
I think a beginner will find it very boring and frustrating, as you're not gonna get much out of it. You'll learn all the constructs of JS, but without knowledge of how those things are applied in practice...I don't think it will stick in your mind.
As a newbie reading The Good Parts, you're just trying to understand and remember everything...
It's like trying to learn how to skateboard by understanding the entire "theory" of skateboarding...
You don't do that. You learn a tiny bit of theory of a trick (x trick is where you jump and flip the board with your foot). You try the trick...then you learn more theory.
Trying the trick helps you learn the theory, because it teaches you what to pay attention to. If your foot keeps catching on the board, you know when you are learning the theory to pay particular attention to what your foot is supposed to be doing.
If you ask most great programmers how they started programming, they didn't enroll in a Com Sci class...they start by hacking out little games and practical stuff...the theory came later.
Reading "The Good Parts" after some practical experience is like a revelation. It's not boring anymore because the entire time you're realizing how this stuff applies to what you have done...it helps you realize your mistakes.....this way it will stick in your mind much better.
When Crockford wrote "The Good Parts" there weren't many good books on JS. That was 2 years ago, an eternity in Internet time, and this is no longer the case.
I recommend the following course:
This is a great book to start with. If you read this book carefully and understand it, you will be ahead of many JS'ers that I have met. It covers everything, including OOP in JS which is something a lot of newbies seem to struggle with. It also contains a considerable amount of theory and technical information.
This is a great read, and if you already know some JS, this will help you really "get" what JS is all about.
This book is more technical, and helps you understand the performance implications of your code. Even if you don't write speed critical code, this book will help you understand some of the JS internals and some advanced techniques a bit more.
If you follow this course, I guarantee you will become a "ninja".
Learn vanilla JS first, and once you are comfortable with it, pick up a library.
There's also a lot of great resources on the Internet, but be wary...there's tons of horrible blog posts by php programmers that will just confuse you.
For reference purposes, check Mozilla Developer Network first.
Check out YUI Theatre, and the JSConf videos.
Read the blogs of the greats John Resig, Crockford, Zakas, etc etc...
Also, there's a lot of great JS communities on the web and irc to help you. Good Luck.
awesome suggestions...thanks :)
Much like the jQuery echo chamber :/
Hey, jQuery is great if you don't know JavaScript and don't want to.