CoffeeScript: Accelerated JavaScript Development

Author: Trevor Burnham
Publisher: Pragmatic Bookshelf
Pages: 138
ISBN: 978-1934356784
Aimed at: JavaScript developers
Rating: 2
Pros: Engaging style, interesting topic
Cons: Too short, lacks focus, often confusing
Reviewed by: Ian Elliot

The subtitle of this book is "Accelerated JavaScript Development". Why is this on a book about a language that isn't JavaScript?
Author: Trevor Burnham
Publisher: Pragmatic Bookshelf
Pages: 138
ISBN: 978-1934356784
Aimed at: JavaScript developers
Rating: 2
Pros: Engaging style, interesting topic
Cons: Too short, lacks focus, often confusing
Reviewed by: Ian Elliot

 

JavaScript is generally under attack for not being an inadequate language to do the important job that has now fallen to it - i.e. building web apps. As a result there are a number of alternatives trying to push JavaScript out of the way. In general these take a classical object oriented approach to language design and so leave nothing much behind of JavaScript - which is a remarkable and very able  language but one that doesn't fit into the classical mould. CoffeScript is different in that it retains many of the features that make JavaScript a good language. Hence the subtitle of this book "Accelerated JavaScript Development" which if you think about it is a very odd thing to put on a book about a language that isn't JavaScript.

There aren't many books on CoffeeScript at the moment and it is difficult to separate feelings for the language from the book itself, particularly as the book has to do a certain amount of publicity on behalf of the new language. In this case the story of JavaScript and CoffeeScript are confined to the preface so many readers might skip this section - don't. It puts forward an interesting argument, although not one I agree with.

 

Banner

 

Chapter 1 is about getting started by installing CoffeeScript. If you are a Windows-based programmer then the bad news is that you need Node.js, which is a good system but doesn't yet support Windows directly. In short you need Cygwin to provide a Linux compatibility layer.

After installation, Chapter 2 gets on with introducing CoffeeScript - functions, scope and context. You can tell that it is assumed that you not only program already, but that you are fairly good at programming in JavaScript. Most of the new constructs in CoffeeScript are mapped to how they compile into JavaScript.

The next chapter expands the same sort of approach into collections and iterations - another major feature of the language. This chapter also introduces the big example used throughout the book  a simple game 5x5 solitaire. An example is a good idea but the code presented is long and difficult to read. It also doesn't really help present any new aspects of CoffeeScript. Put simply the example is more about the game than the language and so doesn't really serve much of a purpose.

Chapter 5 introduces Modules and Classes and again the game example is used. This is the section of the book where CoffeeScripts extensions to the JavaScript approach to objects and inheritance is introduced. After a brief explanation the big example is refactored to use classes - dictionary, grid and player. It might have been better to introduce the example at this point and not have to undo the "poor" inital design.

After 73 pages the book more or less stops being about CoffeeScript. Chapter 5 is on jQuery and Chapter 6 is about Node.js. Coverage of these topics is very shallow and unless you are a beginner I doubt you need to read them. However, if you are a beginner the use of the same game example is likely to confuse you. There is also no explanation of how you can use jQuery from CoffeeScript and no discussion of any alternative ways of doing it. The syntax $-> is just used, leaving the reader mystified as to how this mix of JavaScript and CoffeeScript comes about.

This is a very short book on CoffeeScript and, given the detours into other topics, it is even shorter than it appears to be. If you are a beginner then its constant swapping between JavaScript and CoffeeScript is going to be confusing. If you are a more advanced programmer then this just isn't going far enough. You are probably going to be better off reading the language documentation.

Overall this book is too short, lacks focus on its topic and fails to do the language the service of explaining it to the reader. This is a shame because the author has a readable style and with some more work this book could have achieved its goal - but it would also need to drop the example and present some well-structured CoffeeScript.


Banner


Computer Concepts And Management Information Systems

Author:  C.P Gupta and K. K. Goyal
Publisher: Mercury Learning
Pages: 250
ISBN:978-1683925866
Print:1683925866
Kindle: B08CVSHKG3
Audience: General
Rating: 3
Reviewer: Kay Ewbank

This book is an introduction to the basics of what a computer is, what software is, and what management information syste [ ... ]



The C# Workshop (Packt)

Author: Jason Hales, Almantas Karpavicius and Mateus Viegas
Publisher: Packt
Date: September 2022
Pages: 780
ISBN: 978-1800566491
Print: 1800566492
Kindle: ‎ B0BGRBDJLS
Audience: C# developers
Rating:  4
Reviewer: Mike James
C# is not the language it once was - time for a revival?


More Reviews

Last Updated ( Monday, 31 October 2011 )