Programming With Javascript

Author: John David Dionisio & Ray Toal
Publisher: Jones & Bartlett
Pages: 670
ISBN: 978-0763780609
Audience: Students enrolled on CS1 courses
Rating: 4
Reviewer: Mike James

A book that aims to teach you about computer science and the bigger picture using JavaScript.

JavaScript isn't an obvious choice for the task of introducing computer science, but it probably should be. JavaScript is a very flexible and interesting language that doesn't simply conform to the object-oriented style of C++ or Java. This gives the student the opportunity to think in new ways, but it makes it more difficult to convey the standard concepts that other languages are based upon. Perhaps the most important of these is data type - JavaScript is a dynamic weakly typed language.

The book is also designed to be used in formal education. and it "correlates to the ACM/IEEE CS1 course requirements", whatever this means. One important outcome of it being designed for class use is that it is expensive. It is beautifully produced, but this alone doesn't account for its high price.

 

Banner

 

Inside the book you will find lots of colored panels, easy to read text and self test questions. After a chapter on the general, perhaps too general, ideas of what computing is all about we get started on the real topic in Chapter 2 with a look at how to program using JavaScript. At first we have only single line programs and the use of the language is considerably mangled by the need to keep things really simple. Of course we also have to learn a tiny bit of HTML to provide a user interface but this isn't a real problem. However, by page 35 the book starts to reveal its true nature - we have a table of operator and their precedence. This isn't terrible, but it can be postponed until later if what you are really interested in is teaching how to program rather than ticking off academic points.

Chapter 3 is about data - which is a difficult topic in JavaScript if you are trying to make points about data types. The chapter does a reasonable job but now the level is ramping up. We have logical operators and truth tables and considerations of numerical precision. You need to keep in mind that the book has yet to tackle basic flow of control. 

The next chapter deals with mixing data with operators to give expressions. Here we learn about variables and how to declare them. We also meet the if statement in all its multi-elseif forms. Not the simplest way to learn about such things. Then onto loops and finally exception handling. All too much for the complete beginner to absorb in one go.

From here we move into deeper waters. Chapter 5 explains functions and works its way up to objects. It takes an interesting route to do this in that it introduces the idea that functions are objects by showing a function with properties. This is a good way to go for JavaScript but it might worry the beginner who attempts to move on to any language where functions are not first class objects. Personally I think its great. If you think this is a bit complicated it next tackles "this" and has a good attempt at explaining the idea of context.

Chapter 6 introduces events and the user interface in general via the DOM. Surprisingly it includes a look at touch events. The chapter ends with an example of a tic-tac-toe program.

After chapter 6 the book moves away from pure JavaScript topics and starts to look at ever wider issues. Chapter 7 is about what you might call methodology - objects, inheritance, modules, unit testing, jQuery and so on. Chapter 8 is about distributed computing which in this context means client-server. It covers data formats, REST, Ajax and so on. Chapter 9 is about graphic - general HTML graphics, canvas, SVG and a short section on WebGL. The final chapter is called "Advanced Topics" but its really a collection of topics that didn't quite fit anywhere else - regular expressions, recursion, caching, map-reduce and dynamic event handlers. An odd assortment of topics.

Overall this is a book I liked. It is well produced, easy to read and for most of it I liked the approach. It isn't radical in the sense that it gives up on traditional ideas such as inheritance and strong typing which means it tend so point out how JavaScript is different or deficient - which is probably no bad thing. It clearly has an "educational" approach and it would work well in a class situation. There are instructor resources that include answers to the questions and PowerPoint presentations. Students can access the source code online.

The book's one big problem is that it moves too fast for a complete beginner and doesn't tackle the problem of helping the non-programmer make the transition to programmer. It doesn't spend enough time explaining how to think about the act of creating and realizing an algorithm. Instead is simply presents the ideas of variables, conditionals and loops and expects the student to be bright enough and hard working enough to understand them - eventually. This isn't a problem in a classroom situation but for self study it might be. Finally I have to comment once again on the high price, which probably means you aren't going to buy a copy unless it is a set text - this is a shame.

Further Reading

JavaScript Books (2012)

 

Banner


Code: The Hidden Language of Computer Hardware and Software 2nd Ed

Top Book 2023
Author: Charles Petzold
Publisher: Microsoft Press
Date: August 2022
Pages: 480
ISBN: 978-0137909100
Print: 0137909101
Kindle: B0B123P5GV
Audience: General
Rating: 5
Reviewer: Mike James
Code! We all need to know about it.



WordPress Plugin Development, 2nd Ed

Author: Brad Williams, Justin Tadlock, John James Jacoby
Publisher: Wrox
Pages: 480
ISBN: 978-1119666943
Print: 1119666945
Kindle: B0899MW9CP
Audience: WordPress developers
Rating: 4.5
Reviewer: Kay Ewbank

The authors of this book are well-known in the WordPress world, with more than 100 published plug [ ... ]


More Reviews

Last Updated ( Saturday, 28 July 2012 )