Nov 2011

Book review: haXe 2 Beginner’s Guide

So there’s this haXe book that came out in July, and I was supposed to review it.

For those of you who don’t know, haXe is an ECMAScript-based programming language with awesome features. Its compiler is fast; it targets Flash, JavaScript, PHP, nekoVM (a speedy virtual machine like Flash or Java that is extensible) and native platforms. You can even write functions in it that change the way your haXe code is compiled.

Understandably, people who are new to haXe spend a lot of time using it the way they’d use the languages they’re used to. The haXe 2 Beginner’s Guide covers all the usual things people are familiar with, but then it guides the reader steadily through the trickier concepts. Good thing too, because that’s where the fun is.

haXe code needs to be understood on several levels- the way it compiles and the way it behaves when it is run on each target. That’s a lot of ground to cover, and this book does a good job at it. It reads like a college textbook, though, which is good and bad. A professor who wanted to could teach a basic programming course with haXe and this book, but that’s because basic programming courses tend to cover mundane things like reading and writing to files. They cover client targets like Flash and JS, but only enough to put info onscreen that verifies a connection to the server.

And that’s really what this book is about, after the basic haXe syntax stuff is covered- server stuff. That SPOD thing with relational databases, the haXe templating API (which might have changed a little since the book’s publication; it can be tough to publish guides for an evolving language) and file stream exercises all seem to point to an unspoken expectation that the reader can figure out the presentation layer things themselves. In my opinion, working in the presentation layer is the most difficult challenge in haXe, and apart from the promising NME project, there’s no clear, common solution. haXe has no common graphics API, while it does have a common API for all the things that this book covers, so it’s really no fault of the author. Maybe another part of the reason for omitting graphics stuff is because that subject could fill a whole other book. It would be exciting to see a follow-up publication regarding haXe as a language for developing games and other rich clients for multiple targets.

The book comes with lots of homework, which I did not do, but might eventually. I have more fun integrating lessons into my own projects than completing assignments, but if I decide to take up SPOD, for instance, I’d go with this book.

Overall, this beginner’s guide is a useful resource even for people who think they know haXe inside and out. It’s the best book on haXe I’ve ever read… It’s also the only book on haXe I’ve ever read– there’s not a lot of haXe literature printed nowadays, which makes it just as important to have this book on your shelf. (Or e-shelf.)

haXe 2 Beginner’s Guide – Benjamin Dasnois

You can leave a response, or trackback from your own site.

Leave a Reply