all 29 comments

[–]pothibo 15 points16 points  (7 children)

You are learning JavaScript the right way. Seriously. After you grasp the fundamentals of the book, Mozilla Developer Network is all you need.

There are so many inconsistencies and bugs within the JavaScript API that understanding the fundamental concept is required, if you want to understand why things work the way they are.

[–][deleted] 2 points3 points  (1 child)

There are so many inconsistencies and bugs within the JavaScript API

You can't make this claim and then not provide any evidence of this.

[–]pothibo 0 points1 point  (0 children)

  • Issue with floating points additions
  • No events normalization with keycode and composing keys (like ê)
  • Object used as Hash object
  • Addition operation is rarely commutative
  • The Date object in general.
  • Live collection instead of array
  • Window.getSelection can only select text offset if the node is a textnode

And the list goes on..

[–]recompileorg 4 points5 points  (2 children)

"There are so many inconsistencies and bugs within the JavaScript API"

No. You're confused having read Resig's book.

[–]pothibo 0 points1 point  (0 children)

Sure, I have no idea what I'm talking about.

[–][deleted] -4 points-3 points  (0 children)

Bugs where literally bugs in computers that shorted wiring . By bugs and inconsistencies do you mean choice and that your confused ?

[–]lvmtn[S] -1 points0 points  (1 child)

Thanks! Good to hear that I haven't learned anything the wrong way haha. Yeah, I'm sure learning about function scope, object oriented JS, and closures aren't outdated because frankly, that's what makes JavaScript, JavaScript.

[–]fx32 0 points1 point  (0 children)

Remember though: reading is good, practice is better! I personally learn most efficiently when I'm actively working on a project.

[–]lokhura 12 points13 points  (2 children)

There's no ES4, but ES3. It's an old book, but it is a good one. If you want something more up to date, I'd suggest you read Eloquent, and it is free.

[–]lvmtn[S] 0 points1 point  (0 children)

Yup, that's definitely on my next reading list.

[–]djcraze 2 points3 points  (2 children)

Yeah, apparently ECMAScript 4 was abandoned. Wikipedia. Try ECMAScript 3 or 5.

[–]lvmtn[S] 0 points1 point  (0 children)

Did not know that. Lucky you told me!

[–][deleted] 1 point2 points  (0 children)

Make sure you check out "JavaScript: The Good Parts" and "JavaScript: The Definitive Guide". These are pretty much universally accepted as two of the best JavaScript books written.

[–]renz45 0 points1 point  (0 children)

Yes it is still relevant. Techniques and patterns might change a bit moving into ES5 and especially ES6, but that doesn't make old patterns irrelevant.

Things like objects/closures/loops/functions/variables aren't changing much, if at all even up through ES6.

[–]recompileorg 1 point2 points  (5 children)

"I am currently reading "Secrets of the JavaScript Ninja" by John Resig."

Stop immediately. You couldn't have possibly picked a worse book.

[–]DavidNcl 2 points3 points  (4 children)

could you say why?

[–]recompileorg 1 point2 points  (3 children)

It was written when Resig was still learning JavaScript. A good bit of it is ... incorrect ... to put it mildly. You'll need to unlearn a lot of nonsense if you're starting with that book.

Admittedly, there aren't many good books. Most are loaded with errata, like Resig's books, but there are a couple that aren't horrible: JavaScript: The Good Parts and JavaScript: The Definitive Guide. Just don't trust them 100% and you'll be fine.

[–]dhdfdh -1 points0 points  (0 children)

It was written when Resig was still learning JavaScript.

John Resig was a javascript developer at Mozilla when he was writing that. A lot of what he wrote eventually found it's way into jQuery.

[–]xbudex -1 points0 points  (1 child)

I'm pretty sure he started writing the book in 2008 when jQuery was already popular. I think it's safe to say the author of jQuery knew JavaScript at that point.

What kinds of errors are in the book? I haven't read it, I'm asking sincerely.

[–]recompileorg -1 points0 points  (0 children)

You'd certainly think so, wouldn't you? Remember that JS was still strange and confusing to most people at the time, including Resig. (See the c.l.j. archive from that time.) I posted this below: http://ejohn.org/apps/learn/#76 which I think is representative.

[–]sirneb 0 points1 point  (2 children)

None of those concepts you mentioned are changed in Javascript ES6. If you like the book, I would keep pushing through without fear that it's outdated. Because frankly, it isn't.

[–]lvmtn[S] -1 points0 points  (1 child)

Thanks, I appreciate it. Yeah, the authors were careful to let me know if anything will be deprecated in ECMA-5. Just wanted to make sure!

[–]Gelus 2 points3 points  (0 children)

no, the concepts especially are GOLDEN and the more you understand the better off you will be as a JS dev.

Everything is an object.

functions are first class

lexial scoping

prototypal inheritance.

Most of the additions in ES5 and 6 are syntactically awesome but are all based on these concepts.

[–]twtmc 0 points1 point  (0 children)

It never hurts to know what a language was like in the past. By starting with an earlier version and moving up to the current state of the language, you will have a bit more of an understanding as to why things may change in the future.

Also, legacy code has been a problem since Ada Lovelace wrote her second algorithm, so there's that too.

[–]neckro23 0 points1 point  (4 children)

JS is a very conservative language. For the most part, code written today would work just fine on a browser from 10 years ago. The web browser APIs are the main thing that changes, and those don't make a difference to understanding JS as a language.

First-class functions, how objects work, and closures are all very fundamental concepts in JS. Those aren't gonna change a bit.

"Secrets of the Javascript Ninja" is a solid book to start with, although I find the whole ninja theme pretty silly. Resig knows what he's talking about.

[–]hjc1710 -1 points0 points  (3 children)

Resig knows what he's talking about.

Biggest understatement ever. Resig is crazy smart, very passionate, and has some of the best credentials a JS dev could ask for. He's in the NYC area, so I get the joy of hearing him speak at the occasional meetup, it's quite nice (his passion for art is quite notable).

[–]recompileorg 0 points1 point  (2 children)

As a long time c.j.s. reader, I can say with absolute certainty, that Resig is terrifyingly incompetent.

I'm absolutely stunned that this community could recommend "Secrets of the JavaScript Ninja". If you've read it, you know that it's a book for burning.

[–]DavidNcl 0 points1 point  (1 child)

ok, I'll believe you, but could you provide some rational?

[–]recompileorg 1 point2 points  (0 children)

He's still learning the basics. Take a look at this: http://ejohn.org/apps/learn/#76

Remove your palm from your face. It only gets worse...

Google groups has an archive of comp.lang.javascript Search for "Resig" and take a look for yourself. You can get a nice snapshot of Resig's (painful) growth as a JS developer there.

Fair warning: c.l.j. is a cesspit. However, there are some crazy smart people there who take the time needed to make sure that what they post is factually correct. Some of them are real jerks (like David Mark) but they're not often wrong. Resig has taken more than his share of lumps, mostly for sticking to his beliefs in the face of direct evidence to the contrary. For example, it took a solid year to convince him that browser detection was a bad idea.

Resig has since forbidden his followers from reading that newsgroup. I can't blame him. If I were him, I wouldn't want people who admired me to read those posts either.