hwamiami.blogg.se

Javascript the good parts
Javascript the good parts






javascript the good parts

I may be missing a nuance of the syntax, though.Ĭhapter 4 covers Functions, and includes some interesting bits on function currying (which was new to me) and memoization, with examples of how to use this in your JavaScript code. I don’t see it listed in the book’s errata, but since the only place go from the ‘/’ is into an ‘any character except * and /’ block it seems the diagram would work equally well without the ‘/’. 6 railroad diagram, which appears to include an unnecessary ‘/’ following the opening ‘/*’ of a comment. I particularly liked on page 3, where Crockford writes, “If you want to learn more about the bad parts and how to use them badly, consult any other JavaScript book.” I think I may have discovered a bug in the p.

javascript the good parts javascript the good parts

It’s worth noting that JSFiddle also supports JSLint, which I believe Crockford wrote, and which is covered in the book as well.

javascript the good parts

For example, here’s Hello World implemented on JSFiddle (probably for the millionth time). This of course still works, and it’s important to let people know this option is available, but I think if the book were re-released today, it would be improved if it pointed the user at a tool like JSFiddle, where one can work interactively without the need to deal with files. For instance, Chapter 1 suggests that the reader can easily run JavaScript programs by creating a simple HTML file, and a program.js file, and then opening the HTML file in a browser. The book isn’t that old (published in May, 2008), but it does predate some of the newer JavaScript testing tools available online. I’m not sure they did a great deal to improve my grasp of JavaScript, but I appreciated the attention to detail, and I know I can refer to them if I’m stuck wondering why a particular bit of JavaScript isn’t behaving the way I would expect (which is probably the way it would in, say, C#). I found these sometimes helpful, but I’ll admit that I skipped the full 10 page appendix full of them when I’d reached the end of the book. The book makes frequent use of railroad diagrams, which I’ve seen before but not nearly so widely used as in this book. There’s just enough repetition between chapters to ensure certain points are made and made well. I also appreciated that the book, at only 150 pages including the index, is devoid of fluff. I really appreciated Crockford’s honest, no-holds-barred analysis of JavaScript’s design and language choices. It definitely helped me improve my understanding of JavaScript, which I’ve been using since it was new, but always like a C programmer, and only recently like a JavaScript programmer. Finished up Douglas Crockford’s JavaScript: The Good Parts this week.








Javascript the good parts