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


Beautiful C++

Author: J. Guy Davidson and Kate Gregory
Publisher: Addison-Wesley Professional
Date: December 2021
Pages: 352
ISBN: 978-0137647842
Print: 0137647840
Kindle: B09HTH1X38
Audience: C++ developers
Rating: 5
Reviewer: Mike James
Can C++ be beautiful?



Coding for Beginners, 2nd Ed (In Easy Steps)

Author: Mike McGrath
Publisher: In Easy Steps
Pages: 192
ISBN:978-1840789751
Print:1840789751
Kindle: B0B56LN77V
Audience: Complete beginners to programming
Rating: 4
Reviewer: Sue Gee

This book aims to introduce hands-on modern programming to complete beginners. Can this be achieved in fewer than 180 [ ... ]


More Reviews

Last Updated ( Saturday, 28 July 2012 )