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


PhoneGap 3 Beginner's Guide

Author: Giorgio Natili
Publisher: Packt
Pages: 308
ISBN: 978-1782160984
Audience: Experienced JavaScript Programmers
Rating: 3 
Reviewer: Alex Armstrong

PhoneGap is becoming increasingly influential and beginners need a place to get started. 



Async in C# 5.0

Author: Alex Davies
Publisher:  O'Reilly
Pages: 108
ISBN: 978-1449337162
Audience: C# programmers
Rating: 5
Reviewer: Mike James

Asynchronous programming is all the rage and there is an argument that nobody does it better than C# 5.0 and its async commands. 


More Reviews

Last Updated ( Monday, 31 October 2011 )
 
 

   
RSS feed of book reviews only
I Programmer Book Reviews
RSS feed of all content
I Programmer Book Reviews
Copyright © 2014 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.