JavaScript: the Good Parts

I’ve been trying to build up my JavaScript skills.   That statement requires a little explanation, since I’ve been avoiding JavaScript for years.  I’m not one of those guys who looks down his nose at the language.  It’s just that in the past my every experience with JS always ran into miserable cross-browser incompatibilities.  Also, there were no decent developer’s tools, so tracking down that problem with version X of browser Y was pretty painful.  My attitude was that I could solve all user-interface problems in the middle tier, where I had complete control and I could apply a proper Java debugger.

Lately, I’m long overdue for picking up a new skill.   I know that JavaScript has matured and that there are decent tools available.   Also, although I’m not particularly good at the web or GUI development, I think the user-facing stuff is more fun.  It’s just gratifying to see stuff up on the screen that other folks might use.

My first re-introduction to the language is through Douglas Crockford’s book JavaScript: the Good Parts.  This book is mercifully thin, but the information is rich enough to warrant multiple readings.   Crockford states that there were design mistakes in the language, but that a subset of JavaScript represents a “good” language.

The book covers the basic syntax and then dives straight into object manipulation, including JavaScript’s prototype based inheritance.   It covers functions as first class data types, including some of the convoluted scoping rules.  It goes over arrays and regular expressions, and includes a discussion of JSON.

As an introduction (or re-introduction) to JavaScript, this book gets my recommendation.   It has good coverage of most of the language.    It gets you into the domain and starts you on some good coding habits.  However, I have a disagreement with the basic premise of the book.  Professional developers spend more time reading other people’s code than writing their own.   For that reason, it’s not enough to learn the good stuff, you also have to understand all the other stuff too.

Advertisements

No comments yet

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: