Friday, 19 December 2014

Delphi Cookbook review

A few people have reviewed this book already but for various personal and work commitments, reasons, I've been unable to review the book until now.

It's been many years since a really innovative Delphi book came out that was worth taking a look at. Delphi Product Manager +Marco Cantù's annual book is always an excellent source of up-to-date reference, and Coding in Delphi by the former Product Manager +Nick Hodges was a worthy giveaway to those who purchased recent versions of Delphi.

Delphi Cookbook was written by an author I'd not come across in the Delphi community before, +Daniele Teti. It reminds me of some of the O'Reilly books I have read in the past that, although they don't assume a certain level of knowledge and explain things well enough for beginners, you get much more out of them if you do have some language experience. Indeed, Daniele explains up front in the lengthy preface that it is not aimed at beginners.

The book contains 50 "recipes" covering not only VCL Windows projects, but also cross-platform development using FireMonkey, for Windows, Mac, iOS and Android. It was written alongside Delphi XE6 and so already is one version out of date, but it is not much of an issue in this case because the recipes work much the same across all versions (although XE4 is the minimum required for the FireMonkey cross-platform code).

The first chapter, Delphi Basics, is a real eclectic mix of topics, ranging from the relatively new VCL Styles to parsing XML and JSON, from Windows Services to really old topics such as associating file extensions. These are simple to follow and some, especially the XML and JSON topics, are useful building blocks for later on.

On the whole, the recipes are enjoyable to follow and Daniele has done a good job with the downloadable examples so you can see the ideas in action when compiling them in Delphi.

There is a slightly odd flow to the book; for example, chapter 2 discusses reasonably low-level concepts like RTTI, anaonymous methods and class helpers; this is followed by chapter 3 which discusses styles in FireMonkey, and chapter 4 which then goes low-level again with multi-threading using TMonitor and TEvent.

Probably the most useful chapter for me, and possibly for many now Delphi has entered the mobile marketplace, is chapter 5, which covers writing the server-side application or service, for your remote applications to communicate with. This is neatly followed by a chapter on the mobile basics, many of which are already covered by the examples and demos provided with Delphi. However, chapter 7 also takes you further into Android and iOS platform specifics.

I like Daniele's informal style which sets the tone that this book is really about exploration and fun, rather than about following a "recipe" to the letter. He is often honest in his appraisal of a Delphi feature, which is refreshing, but it shines through that this was a labour of love about a development environment about which he, and his prospective readers, are passionate.

Without the advent of the mobile development in Delphi, I don't think this book would have taught much new to a seasoned developer. But there is plenty of well-explained content in here for everyone to have something to learn. At the very low price it is being offered for, it's a good go-to book to have in your library.