Live data from Hacker News

How to Learn JavaScript Properly

javascriptissexy.com

31–40 of 51 posts

Re: How to Learn JavaScript Properly

#31
post #15
post #7

"But while Mr. Crockford, who is immensely knowledgeable in JavaScript, is seen as the Einstein of the JavaScript world, his book, The Good Parts, is not a good JavaScript book for beginners." Why not? Also, does he mean it's not good for people who are just starting to learn programming? Or also for experienced programmers who are starting to learn Javascript? What would be a good book to start with for experienced…

Recommending Javascript the Good Parts to Javascript beginners is like recommending Effective Java to Java beginners. It is assumed you know some js/java and preferably have written some of it so that the patterns and antipatterns described in both books (Crockford's to a lesser degree, it's after all about the good parts) would make sense.

>Recommending Javascript the Good Parts to Javascript beginners is like recommending Effective Java to Java beginners.

Or, like recommending K&R C to beginners (C beginners, but even worse to programming beginners). There are a handful of books out there that, IMHO, are vastly mis-recommended, and I would agree that JS:The Good Parts is one of them.

Re: How to Learn JavaScript Properly

#32
post #31
post #15

Earlier quoted context omitted.

Recommending Javascript the Good Parts to Javascript beginners is like recommending Effective Java to Java beginners. It is assumed you know some js/java and preferably have written some of it so that the patterns and antipatterns described in both books (Crockford's to a lesser degree, it's after all about the good parts) would make sense.

> Recommending Javascript the Good Parts to Javascript beginners is like recommending Effective Java to Java beginners. Or, like recommending K&R C to beginners (C beginners, but even worse to programming beginners). There are a handful of books out there that, IMHO, are vastly mis-recommended, and I would agree that JS:The Good Parts is one of them.

Weird. I learned C from K&R and found it helpful and easy to follow. I don't think I had much coding experience either beyond c64 basic.

Re: How to Learn JavaScript Properly

#33
I'm currently in the process of learning Javascript. I've use Codecademy to get started in the basics. In terms of books, I've used The Good Parts, Javascript: The Definitive Guide, and Secrets of a Javascript Ninja.

The thing I've struggled with is finding examples of 'good practice' programming which are suitable for beginner to intermediate programmers, which are more than just code snippets.

I'm thinking of small projects, with a code base that it's practical to read in full and understand. I've struggled with using object orientation 'correctly' in javascript. It would also be good to see a full example of how namespacing should be done properly in, say, a small website/webapp.

Any suggestion would be very much appreciated.

Re: How to Learn JavaScript Properly

#34
post #31

Earlier quoted context omitted.

> Recommending Javascript the Good Parts to Javascript beginners is like recommending Effective Java to Java beginners. Or, like recommending K&R C to beginners (C beginners, but even worse to programming beginners). There are a handful of books out there that, IMHO, are vastly mis-recommended, and I would agree that JS:The Good Parts is one of them.

Weird. I learned C from K&R and found it helpful and easy to follow. I don't think I had much coding experience either beyond c64 basic.

I learned from K&R too, and seriously, no book ever told me how closely arrays and pointers were related (atleast, whatever books I read), as TCPL. I don't find anything wrong with recommending it to 'programmers' who begin C.

Re: How to Learn JavaScript Properly

#35
post #15
post #7

"But while Mr. Crockford, who is immensely knowledgeable in JavaScript, is seen as the Einstein of the JavaScript world, his book, The Good Parts, is not a good JavaScript book for beginners." Why not? Also, does he mean it's not good for people who are just starting to learn programming? Or also for experienced programmers who are starting to learn Javascript? What would be a good book to start with for experienced…

Recommending Javascript the Good Parts to Javascript beginners is like recommending Effective Java to Java beginners. It is assumed you know some js/java and preferably have written some of it so that the patterns and antipatterns described in both books (Crockford's to a lesser degree, it's after all about the good parts) would make sense.

Crockford's book explains the best practice in a comprehensive way, but it does not explain why you would want to follow those practices. You need to have sufficient experience with the consequences of bad practice to recognize when and why you would use the practices from the good parts. I wouldn't say you need any javascript experience per se, but a solid background in software engineering is definitely helpful.

Re: How to Learn JavaScript Properly

#36
post #31
post #15

Earlier quoted context omitted.

Recommending Javascript the Good Parts to Javascript beginners is like recommending Effective Java to Java beginners. It is assumed you know some js/java and preferably have written some of it so that the patterns and antipatterns described in both books (Crockford's to a lesser degree, it's after all about the good parts) would make sense.

> Recommending Javascript the Good Parts to Javascript beginners is like recommending Effective Java to Java beginners. Or, like recommending K&R C to beginners (C beginners, but even worse to programming beginners). There are a handful of books out there that, IMHO, are vastly mis-recommended, and I would agree that JS:The Good Parts is one of them.

I found K&R C to be refreshingly easy to follow, but that isn't saying much because prior to that I had learned C++ from Stroustrup's book (which I had to read three times cover-to-cover before I finally understood what in the world he was talking about). Any book would seem easy to follow after that pan-galactic gargle blaster.

And now I'm sure someone will respond saying that they found Stroustrup's book remarkably straightforward. To each his own I suppose.

Re: How to Learn JavaScript Properly

#37
post #9

Earlier quoted context omitted.

Just avoid trying to explain to a newbie that what closures are and that you can pass functions around. That normaly === "mind blow"

I suspect it's more likely to be "mind blow" for experienced programmers of less dynamic languages than novice programmers. Indeed, if you start by declaring functions as variables you're halfway there. The way you pass around functions in, say, PHP (or more accurately, the way PHP fakes it by using syntax sugar for eval) is a lot more confusing.

PHP is terrible, but the following now is valid PHP:

  $addOne = function($a){ return $a + 1 };
  $result = array_map($addOne, array(1,2,3)); // now [2,3,4]
Or:

  // Reference to intval() function.
  $result = array_map(intval, array('1','2','a'));

Re: How to Learn JavaScript Properly

#38
I think different folks have different learning styles. For me books don't really help. I learn programming by programming. Often a well written blog post that I find on HN, or a tutorial that I find from google teaches me something I didn't know before. After a while you get a sense of the quality of a source... After learning like this for a few years, I started to learn a lot by reading the annotated source of libraries I use (underscore, jQuery... etc). I just wanted to throw in that I don't think books are for everyone.
Post reply on HN