JavaScript Crash Course (No Starch Press) |
Author: Nick Morgan The big problem with JavaScript is that it is very much tied into what it is used for. There are currently only two environments in which you meet JavaScript - the front end, the web page, and the back end, the web server. In both cases achieving anything depends on knowing so much more than the language itself. This is a problem for the wannabe JavaScript programmer and for any book that claims to teach you JavaScript. This particular book starts off from the premise that JavaScript is used in a web page and so HTML is part of the subject matter. It suggests you use VS Code, but doesn't give you any idea how to set up Node.js, or any alternative. The first part of the book is a fairly standard introduction to any language. This really is a crash course in JavaScript and in less than 100 pages you are expected to go from noob to reasonable programmer. On the way you meet variables, arithmetic, arrays, conditionals, loop, function and finally classes. The fact that JavaScript is object-oriented doesn't really emerge until the end of the section and then it is presented as a traditional class-based language. All through the section the emphasis is on how to write the code and not any deeper ideas that motivate what you are doing. This is probably OK if you want a slowish pace, but this is not what you get. The ground covered in 100 pages is a lot and things are presented to be complete rather than gradual. For example, you get to learn about two-dimensional arrays straight after struggling with one-dimensional arrays. The second part of the book is titled Interactive JavaScript. but it essentially about integrating JavaScript with HTML. The DOM is introduced and so is event-driven programming. This is the very core of using JavaScript in a web page and it is central to the language. After all, JavaScript was invented to work with HTML. However the topic is covered in about 40 pages and it is the bare minimum you need to know. The final chapter in Part II is about the Canvas element, which is a strange decision in that this is just one HTML element of many. I can appreciate that having Canvas available allows you to introduce graphics, but personally I would have avoided it until later. Part III is about creating projects and its success depends on whether you find the projects appealing. The first is a standard game of Pong, implemented as a non-object-oriented program and then as an object-oriented program. Given that the object-oriented program is the way to do it, I'm not in favor of showing how to do it the wrong way first. The second project is a refection of the author's interests as it all about music. Web audio is certainly not an API that most JavaScript programmers need to master and, unless you know something about music and want to do more with music, it isn't a good teaching example. The third project is about graphics using the D3 library - a good choice but probably not something you have to cover in a crash course. This introduces SVG graphics to create a bar graph and perform some simple animation. Then a final graphics example uses Github to supply some data that is plotted. The main problem with this book is that it focuses on the surface details and does little to give you the idea that there are deeper principles. You can claim that deeper principles are not for crash courses, but the level that most of the details are introduced isn't particularly appropriate either. To spend only 100 pages on the language proper seems a little too rushed and not taking the opportunity of using the DOM as a way of introducing objects is a waste.
To keep up with our coverage of books for programmers, follow @bookwatchiprog on Twitter or subscribe to I Programmer's Books RSS feed for each day's new addition to Book Watch and for new reviews.
|
|||
Last Updated ( Wednesday, 02 July 2025 ) |