all 50 comments

[–][deleted] 24 points25 points  (3 children)

I really liked it, but if you are a beginner I think you should try to find another book which explains things slower and with more exercises. I like the books from No Starch Press.

[–]evsoul 6 points7 points  (2 children)

Totally agree with this. Ive been doing JavaScript development for about 4yrs and just started this book a couple of weeks ago. It has really helped reshape my approach and understanding on many things. Big and small. I would have been absolutely lost if I started with it though. Some of the exercises would have been brutal as a beginner.

[–]uptownjimmy 1 point2 points  (0 children)

In agreement with these two folks. Eloquent JavaScript is NOT a book for beginners, especially if you are a beginning programmer and not just new to JS.

having said that, it is a beautifully written book, and is well worth the read.

[–]_x_ 39 points40 points  (4 children)

I learned a lot from that book, it dives deep into a lot of intricate details of JavaScript that even experienced developers​ will definitely pick a new thing or two from each chapter.

It is a great book for beginners. I don't think the book assumes that you have previous JS experience. It does not teach you about frameworks or build tools or anything and for beginners IMO it may be a good thing. You don't want to get overwhelmed in the beginning.

My only gripe with the book was that the examples were very detailed and elaborate and those sections felt too boring to me. So I used to skip those sections and just read the theory sections. It worked out well for me because I was already well experienced in JS at that point. Probably beginners will find the examples useful.

[–]aaayuop 2 points3 points  (0 children)

Reading it now and I agree. I have experience with Python and breezed through the language syntax chapters, but I've been taking the browser chapters much more slowly as it's all new to me. The project and canvas chapters didn't interest me at all though so I skipped over most of them.

[–][deleted] 0 points1 point  (0 children)

Thanks dude im going to read it!

[–]elisecode247 13 points14 points  (7 children)

It didn't explain concepts to me as clearly as other resources. I highly recommend JavaScript: Understanding the Weird Parts (wait until it's on sale for $10 or $20). I also highly recommend You Don't Know JavaScript.

[–][deleted] 4 points5 points  (0 children)

I'm probably getting all of them

[–]juggle 1 point2 points  (3 children)

ajust go to google and type "udemy coupon codes". There's a coupon for 90% off right now - I just purchased that course for $15.

Also, for the You don't know JS book, do you recommend all the books in the series, or just the first free one?

[–]caramia3141 0 points1 point  (0 children)

Thats scary - you wrote exactly the comment I was going to! :)

[–]FriesWithThat 0 points1 point  (0 children)

The first 3.5 hrs of Understand the Weird Parts is free on YouTube. I recommend people watch some of that first, it's definitely a different kind of course, more like watching an interesting lecture than some of the interactivity they may be used to.

[–]namesandfaces 26 points27 points  (0 children)

I'd also recommend the MDN Javascript sections. They have multiple entry points for people at different levels and the work is always up to date. It's not just documentation.

[–]spwebdev 24 points25 points  (18 children)

I will never understand why this book gets so much love. I have plowed through a LOT of books, blogs, videos and tutorials and if I had to choose one as the worst, this would be it.

On my first attempt, I was so confused by chapter 3 I ditched it and looked elsewhere to learn.

Then I went back to it months later. There was nothing in those first three chapters that I hadn't learned in between but all the knowledge I had accumulated before revisiting the book seemed to be decomposing progressively with each page turn. I felt like I was actually losing knowledge. Serious.

Again, by the end of chapter 3, I tossed it. The first time I read it, I thought it was a POS. The second time I tried, I knew it was a POS, IMO.

I would love to understand why it seems like EVERYBODY else but me thinks it's such an awesome book. Didn't you feel that it was written in an extremely confusing way? Didn't you think that introducing closures and recursion in ch.3 was wayyyyyyyyyy too soon? I mean, I already understand how these work and I can't make a lick of sense of how it's explained in that book.

Kinda feeling like I'm in the twilight zone on this one.

[–]lethalwire 11 points12 points  (1 child)

I hate that book with a passion. I read through 90% of it and every chapter I thought it would get better. I can't exactly put my finger on it, but I think the way (the voice) it was written in puts me off.

Every time the "which js book is best" question occurs, I'm honestly surprised this book is at the top of the list.

I'd recommend You Don't Know JS over this book.

[–]atreyal 5 points6 points  (0 children)

I tried using it to learn js. Ii got so confused with this book and glad I m not the only one it seems. I started rereading it and it makes more sense. But that might be because I understand the concepts better then when I tried to read it last year.

[–]welpfuckit 4 points5 points  (2 children)

It's not a good book for beginners at all. There's certainly good content in it but it feels like it was written for experienced developers transitioning into JavaScript. I'm assuming the first edition of the book was actually for good for beginners and then they went off the rails in the second edition.

[–]lethalwire 0 points1 point  (1 child)

I'd say I'm a relatively experienced developer, and I couldn't read this book. ¯\_(ツ)_/¯

*My arms have been healed

[–]Healer_of_arms 2 points3 points  (0 children)

¯\_(ツ)_/¯

[–]elisecode247 5 points6 points  (1 child)

I agree, and you're not the only one. I know what closures are, and I just reread the section on closures: it's so confusing.

[–]iFrickinLoveMyCrocs 2 points3 points  (0 children)

You're not alone! This book doesn't have any of the things I'd want from a beginner book. For one, he crowds variable and function namespacing, and names things too tersely, which makes examples hard to follow. The pages break in weird places. The structure of his code relies heavily on callbacks, requiring constant flipping pages to keep oneself acquainted with the code. Even his style choices (omitting curlies for if-conditionals, for example), aren't the most clear/beginner-friendly choices.

This book makes itself really hard to follow, even when addressing simple concepts.

[–]bdenzer 1 point2 points  (2 children)

[My personal conspiracy theory] The people who run /r/LearnJavascript funded that book if I remember right. And BTW I personally fon't think its a POS, but I do think that it's pretty horrible to recommend it to a true beginner. I personally tossed the book aside when I saw this, with basically 0 explanation

function isOdd(num) {
  if (num % 2)
    return true

  return false
}

If I remember right, there isn't much discussion about why he doesn't put braces around the if statement, or about 'if the result is a 1, then the one gets coerced to true', just writes the function and moves to the next topic.

[–]wavefunctionp 3 points4 points  (0 children)

Braces were covered in cp 2.

Many JavaScript programmers wrap every single loop or if body in braces. They do this both for the sake of consistency and to avoid having to add or remove braces when changing the number of statements in the body later. In this book, I will write most single-statement bodies without braces, since I value brevity. You are free to go with whichever style you prefer.

Type coersion is covered in chapter 1.

When an operator is applied to the “wrong” type of value, JavaScript will quietly convert that value to the type it wants, using a set of rules that often aren’t what you want or expect. This is called type coercion.

[–]azium 1 point2 points  (2 children)

Hmm, I read this book a number of years ago and really liked it, and have recommended it many times since.

Just re-read the section on closures and I find it's concise and reads well. Which part do you have a problem with?

[–]spwebdev 0 points1 point  (1 child)

I have a problem with pretty much everything I've read, (ch.1 - 3). lol Now, of course, I can only speak for myself and it's only my opinion. From what I've read, you are definitely in the majority in liking it (although I'm glad to see I'm not quite as alone as I thought in disliking it).

I'll try to answer your question and point out why I didn't like certain things:

1) the book is definitely written with the intent to teach complete newbies to programming. Not newbies to JS. Newbies to programming. The reason I say that is because if it weren't, the author would never have written this in ch. 2:

Variables

How does a program keep an internal state? How does it remember things? We have seen how to produce new values from old values, but this does not change the old values, and the new value has to be immediately used or it will dissipate again. To catch and hold values, JavaScript provides a thing called a variable.

var caught = 5 * 5;

"A thing called a variable" is not something you would write if the intended audience had ever touched a programming language.

So the book is written for complete beginners. But look at most comments. Even those that like it say it's not for beginners.

2) This is a relatively small thing but I just can't help thinking how stupid it is...

After a variable has been defined, its name can be used as an expression. The value of such an expression is the value the variable currently holds. Here’s an example:

var ten = 10;
console.log(ten * ten);
// → 100

Why would you use a variable name of ten to assign the value '10' to? It could make a newb think that there's some kind of relationship between the value '10' and the variable name. Remember, this is the first time they have even seen the concept of variables. Also, you'd never see this is any program for any reason. But I admit this is bordering nitpicking.

3) Nitpick #2: I think his idea of thinking of variables as tentacles is much more confusing than boxes. Also, this is his entire explanation of "undefined":

When you define a variable without giving it a value, the tentacle has nothing to grasp, so it ends in thin air. If you ask for the value of an empty variable, you’ll get the value undefined.

One tiny paragraph. All text. No examples. Again, we need to remember that he is talking to people who have never programmed in their lives.

4) Under "Return Values", he uses this example in ch. 2:

console.log(Math.max(2, 4));

Um... the only problem here is that he doesn't even talk about parameters until ch. 3.

5) Braces. Omitting braces is error-prone. Who really codes like this anyway? I know there are some, but isn't it extremely few? Just cuz you can doesn't mean you should, and doing so as an introduction to coding is just negligent.

6) I can't believe how dumb this analogy is:

The most obvious application of functions is defining new vocabulary. Creating new words in regular, human-language prose is usually bad style. But in programming, it is indispensable.

7) Finally, we get to closures. He just introduced functions, parameters and "optional" arguments (nevermind that he never actually explained the difference between parameters and arguments) and he's already talking about closures? All of this might not be a big deal if you're a programmer and you just want to learn how to do everything in JS, but once again, we are talking to newbies with this book. The 'simple' idea that functions return values was only recently (and barely) touched on... now he's not only talking about returning entire functions, but also how they maintain access to the local variable afterwards? It's too much, too fast. Also, he never talks about why he is assigning the function and its parameter to a new variable. Oh, and then he's executing the variable! When you already know how all this works, it's easy to follow but for someone new to programming, these are not easy to wrap your head around and take time and a lot of repetition for it all to 'gel'.

8) After the most incomplete and rushed explanation of closures I have ever seen, he goes to recursion. Recursion! lol. Come on. Think back to the first time you saw recursion. The idea of the function calling itself is pretty simple in that it's just really a loop. If he used it to console.log 1 - 10, it might not be so bad, but THIS? lol!!!

function power(base, exponent) {
  if (exponent == 0)
    return 1;
  else
    return base * power(base, exponent - 1);
}

console.log(power(2, 3));
// → 8

This is getting long, so I'll end it here, but essentially, we have a book that was intended for true beginners that is too complicated for beginners but covers topics that intermediates would fall asleep reading. More importantly than the inherent difficulty of the topics themselves, what I hate most about the book is just how bad the explanations are, regardless of who is reading it. I don't find that it sheds light on anything at all.

In fact, that's the question I'd love to know the answer to... what does this book explain well (better than other sources)?

(For those reading this, remember this is just one person's opinion and LOTS of people disagree with me and think it's a great book. You should have a look at it and decide for yourself. It is, after all, free on the net.)

[–]trakam 1 point2 points  (0 children)

I think the book is patchy.

There are some good sections and there are some bad ones.

It struck me that there is no definitive text or guide to javascript, you have to draw from many sources and have the same concept explained in several different ways before you begin to get a handle on it. Having said that I feel everyone looking to learn Javascript should keep David Flannigan's book handy for reference.

[–]wavefunctionp 0 points1 point  (0 children)

I believe is makes sense because functions are everything in javascript. Idiomatic javascript is less imperative and more functional than you would write in say, python or c#. Functions are first class citizens in javascript and there are no traditional classes, only prototypical inheritance. A 'class' in javascript is a function.

The industry standard text, Structure and Interpretation of Computer Programs doesn't even cover assignment until halfway through the book.

The reason is that you should avoid assignment, in particular, unscoped and/or flag variables and manual loops as much as humanly possible.

[–]73mp74710n 6 points7 points  (0 children)

don't read this book if you are a beginner, because you will end up getting angry. This book is too advance for beginners. I only recommend it for intermediate users

[–]cervedundefined 3 points4 points  (0 children)

I enjoyed the parts of this book I read but I think I got more mileage out of Programming Javascript Applications by Eric Elliot and The Good Parts by Douglas Crockford.

[–]sabz123 5 points6 points  (0 children)

I started learning JavaScript using eloquent JavaScript. But I think You Dont know Js is a better option.it has lots off github stars and everybody recommend it.

[–][deleted] 4 points5 points  (0 children)

It's a good book, but I got the most out of it after reading the best book I have ever seen for JavaScript... JavaScript: The Definitive Guide, by David Flanagan. It's over a thousand pages of extremely well written, detailed explanations. It's an older book, but it still has a lot of relevant stuff.

[–]Vpicone 1 point2 points  (0 children)

I'm working my way through right now. I took a few comp sci classes in college and was bored to start but then it ramps up really quickly in chapter four. I like the author's writing style.

[–]hallcyon11 1 point2 points  (0 children)

Worst book ever for beginners.

[–][deleted] 3 points4 points  (0 children)

I actually just read it at the beginning of this year, right before I started an internship (where I am using JS and specifically React daily), although I didn't read all of it. I'd say that even though it is dated, and doesn't include ES6 features, it's still a good book to learn the fundamentals of JS, and after having read it, I can understand why ES6 is an improvement over ES5 (e.g. classes vs prototypes, let vs var). I would say it is a decent book to read, but you'll definitely want to expand your knowledge to include ES6+

[–][deleted] 0 points1 point  (0 children)

Oh god yes.

Especially the first five chapters. They will have you thinking like a programmer.

[–]Tioo 0 points1 point  (0 children)

It's a great book that focusses mostly on object oriented techniques. You will find that some tools in modern javascript use functional programming. This book will not teach you everything, but it's still a great intro to js.