Å·±¦ÓéÀÖ

Jump to ratings and reviews
Rate this book

JavaScript Enlightenment: From Library User to JavaScript Developer by Cody Lindley

Rate this book
If you're an advanced beginner or intermediate JavaScript developer, "JavaScript Enlightenment" will solidify your understanding of the language--especially if you use a JavaScript library. In this concise book, JavaScript expert Cody Lindley (jQuery Cookbook) provides an accurate view of the language by examining its objects and supporting nuances.

Libraries and frameworks help you build web applications quickly and efficiently, but when things go wrong or performance becomes an issue, knowing how and why they work is critical. If you're ready to go under the hood and get your hands dirty with JavaScript internals, this is your book. Get a short and digestible summary of ECMA-262, Edition 3, backed by real code you can run instantly Examine the creation of JavaScript objects Learn complex values, primitive values, scope, and inheritance Understand the importance of the head object Work with string, number, and Boolean objects and values Discover how to use the null value and the built-in math object Get into the details--beyond Mozilla's reference guide for JavaScript 1.5

Paperback

First published January 1, 2012

36 people are currently reading
191 people want to read

About the author

Cody Lindley

19Ìýbooks5Ìýfollowers
Cody Lindley is a front-end/JavaScript developer and recovering Flash developer. He has an extensive background working professionally (20+ years) with HTML, CSS, JavaScript, and client-side performance techniques as it pertains to web development. If he is not wielding client-side code he is likely toying with interface/interaction design or front-end application architecture. When not sitting in front of a computer, it's a sure bet he is hanging out with his wife & three boys in Meridian, Idaho. In his spare time Cody is working towards being a "One Dollar Apologist" and enjoys defending the evidence for a classical Christian world-view with reason and empathy at c-m-c-a.com.

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
41 (21%)
4 stars
68 (35%)
3 stars
49 (25%)
2 stars
22 (11%)
1 star
11 (5%)
Displaying 1 - 26 of 26 reviews
Profile Image for Rob.
AuthorÌý2 books428 followers
January 3, 2013
tl;dr: It's a 150 page essay on auto-boxing, full of dangerous code examples and anti-patterns and soft warnings to "not do what I just did", and some of the wording is not-wrong-but-not-quite-right, but hey there are some decent parts, I guess.

Cody Lindley's JavaScript Enlightenment has an awesome title, and I wanted very much to like it--but I think I'm going to have a hard time recommending it to anyone. Maybe.

Lindley states that the target audience for his book is (effectively) JavaScript dilettantes. In his words:

...it is my hope that the material in this book will transform you from a JavaScript library user into a JavaScript developer.


I interpretted that statement to mean that he is looking at the designers and the junior developers and the programmers coming at JavaScript from other languages--all the ones out there that have been using jQuery and/or ExtJS and/or Dojo with effectiveness (or at least competence) and now they're interested in digging into the guts of their favorite library, and perhaps even getting their heads around that thorny beast called JavaScript.

This is an admirable goal, and one that I fully support. But when I got to the end, I scratched my head and wondered aloud: "Did I just finish a 150 page essay on ?"

Understand objects and you will understand JavaScript.


This is (more/less) Lindley's thesis statement for the rest of the book. From there, we have a lot of discussion and exposition about JavaScript's types, including quite a bit of examination into how the various primitives are coerced (behind the scenes) into their wrappers and then back down again. Lindley is right, this is important stuff to know if you want to have a deep understanding of JavaScript--but if you're at the point with JS libraries that you're taking a wrench to the plumbing, then you've probably already gotten this information on your own already. (Or else have learned how to look it up in or or the .) But my skepticism about this might be totally unfounded--perhaps there is a big audience for this kind of book. (Most of the ratings on Å·±¦ÓéÀÖ are 5 stars.)

But... My biggest issue comes from what I perceive to be a... almost reckless or dangerous approach to presenting the material. What I mean by this is that while many of the code examples are technically correct, they are not idiomatic -- in other words, you wouldn't see code like that "in the wild." (Or shouldn't, anyway.) Sure, you can use the String constructor to create strings -- but this almost never offers you any advantage over simply creating a string with literals. (Most of the time it will hurt you, or confuse the typeof operator, or lead to some other language quirk that will catch a JavaScript novice off-guard.) Granted, to Lindley's credit, he states in numerous places in the text that "no one really does this" or "you should just use the primitive/literal form of this" -- but after also asserting (right at the very beginning) that the reader should pay more attention to the code... Well, I'm fearful that those same readers will pick up hard-to-break bad habits.

And I think that's why my reaction was to think: "This is a dangerous book."[^1] As an author, you're in a powerful position as a teacher and role model--so if you're demonstrating "weird" code or error-prone techniques or calling things by the wrong name[^2], then you might wind up influencing a bunch of developers into those bad habits--even if you didn't mean to, even if you warned them against those exact methods.

Perhaps I'm over-reacting a little bit, but believe strongly that these things matter.

"Comma-first" or abusing is one thing... But using Number where you should be using parseInt is quite another.

I had other criticisms as well (e.g., talking about "associative arrays" is always a sketchy proposition when your target audience is JS novices; e.g., making no mention of strict mode whatsoever[^3]) but they're really just pale variations on "the big one" above.

So where do I land on this book? For all my critique of it, I am not sure that I have a recommendation that fills quite the same niche. Addy Osmani's came to mind first--but then I thought about how that might actually be a follow-up read to JavaScript Enlightment. If Osmani's Patterns book is out, then so is Stefanov's . And Lindley more/less explicitly calls out Crockford's as the kind of book that would scare off his target audience. Nicholas Zakas' new book, , is very similar in what it covers, and has more/less the same thesis... According to my survey, that's the closest contender. (And each offers something that the other does not so...)

I guess my final verdict is that I'd recommend Zakas' Principles of Object-Oriented Programming in JavaScript, and if it scares you too much then back-track to JavaScript Enlightenment -- but with the caution that you need to be disciplined in how you approach it, because we can't have you littering your code with new Number(1).

----

[^1]: I had a similar reaction when I reviewed .

[^2]: For example: not calling "auto-boxing" by name. For example: calling it a "self-invoking anonymous function" instead of an .

[^3]: The omission of seems like a major oversight to me. I realize that Lindley's discussion was germane to ES3 and not ES5--but 'use strict' is out there in the wild, and it can dramatically alter some of the behaviors described in this book. If the target audience really is people that are diving into the plumbing of their essential libraries, then some of them are going to see this and not realize the significant implications it might have w/r/t/ some bug they're trying to trace.

[^4]: Perhaps even too colloquial from time to time. "Grok"? Seriously? We need a moratorium on this so-called word.

----

Disclosure: I received an electronic copy of this book from the publisher in exchange for writing a review.
Profile Image for Kaela.
1 review2 followers
October 26, 2014
I attempted to read this book before knowing anything about js, and it was too difficult to comprehend. After taking a few courses on codeschool, this book was a breeze. It really helps instill the "why" behind the language. Great book!!

The author does repeat himself a LOT, and even warns readers that he will do so. If you already know the language really well, the read may drag for you. If you're having a difficult time understanding js, the book will drive home important concepts.

On a scale from 0-10 (newb to expert js developer), I'd recommend this book to learners around the 2-4 range.
34 reviews2 followers
September 10, 2013
Helped me to get a deeper understanding of JavaScript. Since JavaScript is the foundation for all the front end frameworks, I believe a good understanding of JavaScript will help me to be a better front end developer.
1 review
Read
April 15, 2019
It's an exceptional book. It's small, simple book with lot of information .
Profile Image for Colle Owino.
82 reviews24 followers
May 21, 2019
One of the few short books that I actually enjoyed. It wasn't too heavy on the side of explanations but it gives you just enough to be satisfied. Most of the chapters were quite repetitive but its makes them more standalone and I highly recommend it if you want to grok the core concepts of Javascript.
12 reviews1 follower
March 23, 2022
Clear - Crisp - Concise.

Was wonderful a few years ago, Just not so relevant in today's ES6. (Yes i know all the rules are still same, but now kids aren't learning JS in the same way in those days)
Profile Image for Isidro López.
141 reviews26 followers
January 8, 2019
I would recommended reading "The Good Parts" much more than this one, specially for someone who has not already "interiorized" the JS "best pracitces"...
Profile Image for Rachel Nabors.
AuthorÌý3 books107 followers
August 14, 2012
I got into web development from the web design end of things. I've always wanted to master JavaScript and release my bonds to libraries like jQuery. Other web developers told me to read "JavaScript the Good Parts" and "Eloquent JavaScript," but invariably I'd get a third of the way through the book before falling asleep. Those books were written by people with computer science degrees for people who are programmers first, designers and front-end implementers second.

This book is not like that. Cody assumes you can't tell the difference between "object oriented" and "procedural." In the first few pages he illustrates what an "object" is: a collection of value pairs. Then he illustrates how everything in JS is just an object. And he builds on that to explain prototypal inheritance and closures.

And for the first time in my life, I got it. Those other highly recommended books make so much more sense now. If you're having trouble wrapping your brain around JS, this might be the starting point for you.
Profile Image for Nate Berggren.
4 reviews1 follower
March 9, 2013
I would recommend this book only as a companion to another book, such as Crockford's JavaScript: the Good Parts. It was useful to me to read an alternate explanation of many of the concepts that Crockford covers in his book. After reading Enlightenment, I re-read The Good Parts, and it made much more sense.

Here what i didn't like about the book. The text is extremely repetitive. While Lindley warns in advance that he will be repeating important concepts, I believe he goes overboard. The code examples include too much boilerplate, which obscures their readability. Another reviewer mentioned the anti-patterns and suggestions to not do what was just demonstrated.

I also find excessive use of the word "grok" in writing—other than by Heinlein—to give the impression the author is trying too hard to be hip.
Profile Image for Ahmed Boha.
2 reviews
November 8, 2015
Why this book is given such a low rating is beyond me. This book will teach you almost everything a professional JavaScript developer needs to know.
I mean this guy Cody Lindley does know what he's talking about, if only he were as good a tutor as he is a developer, although this wasn't the biggest flaw of the book. That honor goes to his oversimplification (as well as over-complication) of certain subjects he discussed throughout the book. The author goes on and on about some stuff he had already discussed and explained. Had this book been trimmed down to 90 pages instead of over 160, this book would have been a must-have guide for any modern web developer.
Nevertheless, this is a stellar book to help "enlighten" you about anything JavaScript.
Profile Image for Jeroen.
54 reviews2 followers
March 24, 2013
He really hammers it in.

I enjoyed reading the book and learned a bit of the inner workings of the language. (some sidesteps in to "Eloquent Javascript" and some more on closures also helped)

Mr. Lindley does come over as very repetitive, hammering again and again on the fact that primitives are stored as values (eg).
This repetitiveness got a bit boring in the end. The good thing though is that you really feel like you're learning something. "I already know that dude".

I understand a bit more of javascript now, which was the point. I made quite a few annotations and will be sure to check back later.
Profile Image for Derek.
53 reviews3 followers
October 26, 2016
If you need to build your JavaScript knowledge from the ground up, I'd recommend reading JavaScript Enlightenment, or a book like it, and then jumping into Crockford's The Good Parts. The two books are fair companions - JavaScript Enlightenment is a good, basic look at JavaScript, and the Good Parts is a more conversational, deeper dive.

A similar book written with ES6 in mind would be preferable to this one, but Lindley's book is still a good resource if you can't find another. If you're an experienced developer and have been writing JavaScript for a while, I doubt you'll learn anything new from this book.
Profile Image for Rob 'Crash'.
4 reviews
January 15, 2013
I've been writing JavaScript for about 2 weeks and mostly just libraries, our but this book didn't really give me much new information. What information it gave seemed to be repeated two or three times. I actually looked back and forward through the text multiple times to see if my eReader had dropped me back a page or two. It seemed like the same concepts were given multiple times. And not in a way that helped me understand it better, but so I thought I was actually reading the exact same pages over and over.
Profile Image for Donald Guy.
25 reviews10 followers
June 12, 2013
Super redundant and not very informative really. Maybe a decent novice book but not even sure of that. Honesty, the table of contents is maybe a decent couple pages of reminders, but the content of each section rarely actually says anything else and code samples are mediocre to shitty. On the plus side, It's a quick read.
1 review
March 22, 2013
This takes the cake as one of the worst books I've read. How do I get that time back! I felt like I was being lectured by a student who fronts like he knows programming, and struggles to be taken seriously. But you hear and sense the lack of conviction. Do these publishers screen these guys?

Eloquent Javascript would be a better fit for novice, and even seasoned developers/hobbyist.
Profile Image for Ian.
51 reviews
January 24, 2014
As a "self-taught" JavaScript author, I found this book tremendously helpful at filling in the gaps that come with learning via StackOverflow. The author's concise writing style is a treat, although the last few chapters are basically the same thing with some Find & Replace going on. Great book, would highly recommend to anyone who feels like their foundation needs repair.
Profile Image for Lars De Richter.
48 reviews
June 1, 2014
I would not recommend this book for learners. I did like the idea that it starts from objects, but when using this to teach javascript to real beginners, it failed miserably. It simply becomes too complex too quickly and it is by far too abstract for beginners. For more advanced programmers on the other hand it is too tedious with all its repetitions.
Profile Image for Jason Gill.
24 reviews2 followers
August 12, 2014
I have always struggled with OOP in JavaScript, but this book has changed that. Very helpful and well written examples. If you already know JavaScript, but just need an OOP crash course, the first couple of chapters is all you need. The rest is mostly review, hence 4 stars instead of 5.
Profile Image for Joel.
17 reviews30 followers
February 16, 2013
Good introduction to the basics of Javascript, very repetitive (though author warns in preface) which isn't terrible considering how terse the copy.

Sample code is all available as live code via link in e-book, which is a nice modern touch.
106 reviews64 followers
March 9, 2013
A little redundant at times, but I think this book is a good first read before jumping into a more advanced JavaScript book like JavaScript: The Good Parts...which I plan to reread now that I have a better understanding of the prototype stuff.
Profile Image for Katherine.
149 reviews
June 29, 2013
OK for beginners but this is not an enlightening beginning if you pick this up as your first book on Javascript. Great title though!
Profile Image for Enrique Sánchez.
13 reviews3 followers
Read
March 28, 2014
Super easy to follow and to the point short overview of objects in JavaScript, as well as their inheritance and prototype.
Displaying 1 - 26 of 26 reviews

Can't find what you're looking for?

Get help and learn more about the design.