Tag Archives: books

Two Books

I’ve recently received review copies of a couple of new books. Here are the reviews of those books that I have submitted to Amazon.

Designing the Internet of Things – Adrian McEwen & Hakim Cassimally (Wiley)

I’ve been hearing people talking about “the internet of things” for a few years now. And I’ve always meant to find out what they meant by the term. Well now, thanks to this book, I have a really good idea. I might even think about building something for the internet of things myself (you know, in my copious free time!)

Adrian and Hakim obviously know what they are talking about. They both have experience of working on these kinds of projects. And, crucially, they also have the writing skills to pass their expertise on to the reader.

Some of the stuff in the earlier chapters, I already knew. But things like an introduction to TCP/IP and networking will be useful to many people who don’t have such a technical background. Software, I can do – it was the chapters about hardware that I found most useful. I now know far more than I did about the different toolkits that are available for building internet-connected devices.

Part I is about prototyping your device and part 2 is about building it. I’m sure that other books cover these topics – although, perhaps, not in the focussed way that this book does. But it’s part 3 where this book really shines. These three chapters cover business models, scaling your manufacturing process and some of the ethical issues that these devices raise. This section really makes the book a “one-stop shop” for finding all the information you’ll need to take your vague idea to a complete product and (hopefully) a profitable company.

Perl One-Liners – Peteris Krumins (No Starch)

Perl one-liners are an important part of its power and flexibility. The ability to process a file quickly without having to write a program is often really useful. Any Perl programmers should take the time to get to know the command like switches that make this possible. This book is a pretty good introduction to this way of using Perl.

So why only three stars? Well, I have a couple of reservations about the book. Firstly, there are a few technical errors which the editors should have caught. For example, a few times the author refers to “array context” where he means “list context”. The difference between arrays and lists is often difficult for beginners to master and it doesn’t help when books blur the distinction.

My other reservation is with the programs themselves. The book boasts “130 programs that get things done”. But I think they have had to stretch things a bit to get to that number. One program might be “print lines that match a pattern”. Then the next program will be “print lines that don’t match a pattern”. I’m not sure that inverting the logic in a one-liner is enough of a difference to justify counting it separately. Sometimes you’ll come across two or three pages of examples all of which are only tiny permutations of each other.

But it’s good to see publishers bringing out books on Perl. And this is certainly an area of Perl that hasn’t received much coverage before. I just think it’s a rather thin concept to spin out to a book. Even this stretched, it’s a rather thin book (140 pages – 50 of which are appendices). It might have been better as a cheap Kindle-only publication.

Perl Books

The Perl community on LinkedIn is fascinating. It’s a great way to see how Perl is perceived and used outside of the echo chamber. And that’s a real eye-opener.

Here’s an example. Every few weeks (it seems) someone asks for advice on Perl books.At that point a few people will jump in with sensible suggestions. But for every reasonable suggestion, you’ll get three or four people suggesting something from this list:

  • Something horribly out of date. A lot of publishers stopped updating their Perl books about ten years ago. The most recent version of Perl Black Book that I can find is from 2001. Teach Yourself Perl in 21 Days was last updated in 2002. Perl By Example dates from 2007. I haven’t read any of these books, so I can’t comment on their quality, but I’d be really wary of suggesting that someone learns Perl from a book that is so out of date. Before the days of Amazon, these books would quietly disappear from bookshops, but now they always seem to be available.
  • Something out of date, but that used to be great. There are plenty of books that I would have recommended when they were current, but that I wouldn’t really want to recommend now. A lot of these are O’Reilly books that haven’t been updated recently – Advanced Perl Programming and The Perl Cookbook, for example. I’m sure there’s lots of good stuff in those books. But I really wouldn’t want anyone to read them if they didn’t already have enough experience to update the Perl to current best practices. I sometimes recommend these books myself, but only in specific circumstances. Whenever I run a course on OO Perl I mention Damian’s book. But I also point out that there have been a lot of advances in the area since the book was published. And, I have to confess, my own Data Munging with Perl fits firmly in this category.
  • Something of dubious provenance.  Most of these discussions will, at some point, attract a link to some dubious web site in Eastern Europe that contains the full text of O’Reilly’s various CD bookshelves. I know that these sites exist and I know that there’s nothing that O’Reilly can do about them, But I’d rather not see them mentioned on a professional site like LinkedIn. And quite apart from the copyright issues, there’s the fact that most of the books on these sites fall firmly into the first category above. They’re all over ten years old.
  • Some great tutorial on the internet. I’ve talked about the problems of old and dodgy tutorials before. And things definitely seem to be looking up. We are getting more good tutorials out there. But people still insist on sharing links to the tutorial that they learned from. Even if it’s appalling.

In a recent discussion someone said (and I’m paraphrasing) “just go to Amazon and look for the highest rated books”. I think there are two problems with that:

  1. The people who are rating beginner’s programming books on Amazon are usually the least qualified people to do that. Sure, they can tell how easy the book was to read and how well they picked up what the author taught them. But they have noway of knowing whether what they learned was accurate or useful.
  2. Amazon ratings last forever. But, as noted above, the quality of a technical book in fast-moving subject like programming falls over time. Perhaps Amazon ratings on programming books should have a half-life.

Here are some examples of things that you’re going to miss out on by using outdated Perl references.

  • say – We all love say, don’t we?
  • Lexical filehandles – Storing filehandles in lexical variables is great. I no longer have to worry about bareword filehandles being reused elsewhere in the code.
  • Defined or operator – There’s now no excuse for the $val ||= $default bug.
  • given/when – Perl has a switch statement. And it’s better than anyone else’s :)
  • Unicode support – Perl’s Unicode support is second to none. Except, if you’re using an old version of Perl in which case it’s a bit rubbish. And if you’re reading about Perl in an old book, then you won’t know about it.
  • State variables – Ok, I don’t use those every day. But when I need them, they make my code cleaner.

And then there are all the great CPAN modules that aren’t covered in books that were written before they were released. Would you really want to introduce someone to OO Perl without mentioning Moose?

My rules for recommending books are pretty simple. They should be books that I’ve found useful and they should have been published in the last few years. And given the falling numbers of Perl books that are published each year, that’s now a rather small number of books. Perhaps a dozen or so.

Am I being too harsh? Can beginners get something useful out of older Perl books? How do you decide whether to recommend a book to a colleague?

Perl Books

Those of you who have been following my work for some time might remember that many years ago I took some interest in Perl books. I don’t mean the kind of books that we all read (or, even write) with animals on the cover. I mean the kinds of terrible Perl books that at one stage seemed to take up over 90% of the space given over to Perl books in most bookshops. They had brightly coloured covers and made unlikely claims about how good you would be with Perl after an unfeasibly short period of time.

They all seemed to be written by people who didn’t actually know anything about Perl and they were full of the most atrocious Perl code that I’ve ever seen. Of course they were all not just about Perl but were about CGI programming with Perl (as that’s what everyone wanted to use Perl for ten years ago). It was easy to tell the quality of these books from the index. You just looked for mentions of “use strict”, “use warnings” or CGI.pm. Most books ignored them completely. At the time Schwern had a “litmus test” for the quality of Perl books. It was list of bullet points that you could use to easily calculate how bad a Perl book was. I seems to have dropped off the internet at some point in the last ten years.

Last weekend I was in the centre of London and I went into a couple of large book shops that I haven’t been to for some time. And it looks to me as though this problem has finally gone away. Looking at the Perl section in Foyles, for example, I saw a very few dodgy Perl books. Of course, there were far fewer Perl books of any quality than there would have been five or six years ago, but the ones that were left were pretty much all decent books.

My initial thought was that this was just another sign that Perl has lost the battle for the low-end web development market. People who want to hack up a web site no longer even consider using CGI programs written in Perl. These days those people would all use PHP. But it seemed to me that there weren’t many “Learn PHP in 24 Hours” books on the shelves either. So perhaps the low-end web development market doesn’t exist any more. Or, at least, perhaps it’s not big enough to make it profitable enough for publishers.

I’ll admit that my sample wasn’t particularly big. And Foyles isn’t exactly your average book shop. It caters for the higher end of the book-buying market. I wanted to test my hypothesis by looking at the computer books section in Borders over the road. But Borders has closed down. Another indication of the diminishing size of the book market.

I’m going to take this investigation further. I’ll check out the computer section in some lower-end book shops. But just to give myself some closure I’m going to declare my campaign against bad Perl books to be over. We won in the end. But it may be a slightly Pyrrhic victory.