Should I buy that Perl book?

tags: catalyst  economics 

I originally published this at as Should I buy that Perl book?

I wrote this over a year ago, but I never posted it. I found it again when I was writing Can you learn Perl from an old Learning Perl?. I still like it, so I’ve give it to you.

At the heart of this question is (probably) the definition of economics: “How do I spend my limited resources on any of my alternatives to reach my goal?” There are, at least, three components there:

  • Your resources (money, time)
  • The alternatives
  • Your goal

The first two are easy to quantify. You probably know how much money, time, and effort you want to spend. You can easily get a list of books available for acquisition (donation, purchase, library loan). The third one is a bit more complex, and the hardest one for a book’s author to satisfy. It’s also the one that makes Mike’s question almost impossible to answer, so start with that.

What are the goals?

Here are some possible goals you might have in buying a Catalyst book:

  • Learn Perl and web technologies
  • Use Catalyst to make a personal website
  • Use Catalyst to make a commercial website
  • Become a Catalyst developer
  • Maintain Catalyst applications written by others
  • Understand Catalyst enough to know what your programmers are talking about
  • Learn various wet chemistry organic synthesis techniques
  • Work on catalytic converters for muscle cars

Someone who wants to become a Catalyst developer will probably want to spend more in resources than someone who wants to merely get an overview without actually using Catalyst. Even two people with the same goal might want to spend different resources.

If you’re trying to do the last two goals, make sure that you can return the book once you get home and realized you were in the wrong section of the bookstore.

What are the costs?

There are several sorts of costs, which many people at least know subconsciously. A cost is something where you lose resources. There are two that matter, but there are some other sorts of costs that shouldn’t matter.

There’s the acquisition cost. That’s the particular sub-cost that most people call “cost” or “price”. It’s the amount of money that disappears from your bank account or wallet. This is the easiest cost to pay, and the easiest to see because a number changes. But, it’s only the beginning. Buying a gold mine doesn’t get you any immediately-usable gold, after all. You still have to work your mine. If you just want to decorate your bookshelf, there are probably prettier books for the same price, or you can print the spine yourself and glue it to cardboard for much less, perhaps to hide your secret stash of, well, whatever you need to secret.

The opportunity cost is what you prevent yourself from acheiving by choosing a particular alternative. If you get one book, maybe you won’t have the resources to acquire a different book. That might mean that you don’t have enough money for another one, or you run out of time before you find out the first book isn’t for you. You used your resource for the wrong thing.

The opportunity cost is the partly the time that you spend reading the book and putting it into use, and the cost of you perhaps doing the task in a completely screwed up manner that keeps you from acheiving your goal later. That might mean that Catalyst isn’t the right tool for you and you use it anyway, or that you learn the wrong way to use Catalyst and code yourself into a corner. Those might be high costs. If you get the wrong book, and there are many bad Perl books, you might learn many wrong things or bad habits that you have to unlearn later. Some of those bad habits might cost you hours of debugging.

Opportunity costs might be low, too. It might mean that you didn’t have the time to read some other book during a plane ride and that’s the end of the story. It’s this last one that seems to be the most frustrating because the low opportunity cost makes your acquisition cost seem more important than it is. A lot of people will think “I just wasted $40 on this book” instead of “I just saved myself tens of thousands of dollars by not using the crap in this book that only cost me $40 and three hours”. It’s not just about what you actually give up, but what you avoid giving up.

What are the alternatives?

There are at least three alternatives to learn about Catalyst. Two are published books and the Catalyst documentation that includes a tutorial. There may be other bits and pieces out there too. These alternatives are not exclusive for someone with unlimited resources. Most people would rather not spend all of their time reading every Catalyst resource, though, so in reality people tend to want the best alternative for their goal.

Set aside the unstated goal. Assume that you know your goal and that The Definitive Guide to Catalyst is an alternative for this. The problem is that before investing the money and time, you can’t judge the benefit. Maybe you’re new to Perl or new to just Catalyst. Maybe you’re been using Catalyst, but haven’t been following its development. You doesn’t recognize the authors names (not so odd considering those aren’t the names they’ll often use online). You have incomplete information to judge the likely outcome, so you ask around. Many people know that many tech books are crap. What’s the likelihood of this one being crap?

Expert or respected opinions mean a lot for people because you can translate your estimation of the person to the quality of the alternative they are considering. Indeed, this is one of the values of being part of the Perl community, especially Perl mongers. You get to create your own recommendation network. You learn about other Perlers and what they like, and you can compare that to what you like. Even if you’re talking about your favorite operating system or editor, the eternal and unanswerable questions, you can develop affinities for the opinions of different people. If you like Catalyst and Moose, you might also like the same other things that other Catalyst and Moose people, even if that’s English IPAs. You’re probably used to this in other areas as movie reviews, the Parker scale for wines, Consumer Reports, collaborative filtering, and so on. These don’t always work out, but then what does?

Yanick Champoux, a respected Perl community member, reviewed this book for The Perl Review. He says:

The Definitive Guide to Catalyst by Kieren Diment and Matt S Trout is not only a good introduction to Catalyst, but also provides an excellent overview of modern Perl best practices. Rather than focusing solely on the application, the authors adopted a much wider approach and take great care to cover the whole development process.

Yanick also goes on to say:

It is well-written, well laid out, and beginners and veterans alike are almost assured to learn something new from it. If you respect Yanick’s opinion, and I think most people would based on his community standard, you’ll think this is a good book. It’s probably not going to steer you in the wrong direction.

There is a caution, though. With an affinity for certain sources of opinion, they are more likely to lead you astray because you are less critical of those opinions. You’re more likely to fall into groupthink, a whole different problem.

What will you get out of it?

So, you’re thinking about spending some money and time on a book. That total investment means something to you. You expect that you’ll receive more than you put in, but more what? There really is no what, but just call it “value” instead. That value doesn’t really have a definition because you have to determine it for yourself, both in terms of how much you “value” what you put in and how much you “value” what you get out. Ideally, your output has more value than your input.

Everyone is going to calculate “value” differently because the money and time have different meanings for them. It’s a personal thing. To many people, a roll of quarters is $10, but to a person who needs to do laundry tonight at a coin-operated laundromat that only takes quarters, that roll of coins might be worth $15, or more, out of the change machine because they get clean clothes. A grocery store near me sells $10 for quarters for $12, but that’s not so odd considering they have a cost to provide the service of obtaining, storing, and providing the quarters.

Some people think that if they put in 100 hours reading a book, it should save them at least 100 of work later. That might be a good first estimate, but that assumes that you value the 100 hours of reading the book the same as your 100 hours of using what you know. You’re probably shortchanging your output.

If you read that book while you had an excess of time, when time’s a less valuable resource since it is less scarce, but then used the knowledge during a time-sensitive crisis with a hard deadline that delivers a lot of revenue to your company, those 100 hours of preparation might be offset by two hours of application because the crisis time was much more scarce. One thing that you learn in reading might save days of thrashing when it counts.

Likewise, a week spent studying a book for a one-hour job interview that leads to stable employment, even if you never use anything from that book, might offset that 100 hours of preparation with 1 hour of interview. That plane ride to figure out that Catalyst is not for you might be completely worth it to reduce alternatives that you don’t pursue.

That’s the problem of worth: there is no such absolute beast. It’s a personal decision based on how much you value the outcomes.

But, most interesting to me as a book author, is that your small investment in a book, even if you don’t use the technology, still makes it possible for you to buy that book and many other books because there’s a way for more knowledgeable people to exchange their time for your money. As a societal construct, you end up with many books that you might buy. New people have a justification for writing new and different books that you might like. You might think that you wasted $40 on one book, but if you amortize that over all the books that weren’t a waste, it’s not so bad. It’s almost insignificant.

In conclusion

So, is The Definitive Guide to Catalyst worth it? I don’t know: GOTO 10.