fREWdiculous!
22 Jul
I am just getting through chapter four of the Catalyst book and there are already a whole lot of things worth mentioning. My internet is currently at 50% packet loss because our wifi router is busted so this is pretty painful for me. So we’ll keep it short.
The book has a nice (very short) introduction to Moose. Not only is this good because Catalyst is now based on Moose, but also I would say you probably want your OO code to be based on Moose. There are times when you probably don’t want to use Moose, but there are also times when you don’t want to use strict. As a rule, use Moose for OO code.
There is also a very good introduction to usage of CPAN. A lot of us think that CPAN is our programming platform. Knowing how to use it is extremely important. It includes not just finding stuff on CPAN, but also ascertaining the quality of those modules, and how to install them. Very good information for a perl programmer.
In chapter 4 mst discusses how he writes tests (which can be slightly supplemented with his latest blog post) and it’s actually quite helpful. Some people write tests after writing their code and run the risk of forgetting to test at all (that’s me!) Other people are all hardcore TDD and write tests first, but that assumes that they have already thought through the interface for what they are writing. mst posits that it’s better to write your code, and “test” it from test files as you go. And test in this case means warns, Data::Dumps, whatever. After it works how you expect, you then take those warns and whatnot and translate them into ok’s, is’s, and cmp_deeply’s. It’s really much nicer than the alternative: build it all and see if it works. Try it!
Lastly, I really like how they represent code as diffs instead of monolithic code. Writing large swaths of code doesn’t work that well in real life. It works much better to do tiny changes and make sure they still compile, do what you want, etc.
But the book certainly isn’t perfect! There are some weird code layout issues, (p34, 36, 39, etc) and I am pretty sure I saw at least one syntax error (END__ instead of __END__).
So far though, I would say that the book is better than most programming books. Really, a lot of programming books need to be more like this, instead of focusing entirely on the arcana of one framework they should help you be a better programmer overall.
6 Responses for "Initial Impressions of Catalyst Book"
No offence to Jonathan Rockaway but his book was not good. I’m not buying this one until I hears some good feedback from people who have read it.
Last summer at YAPC::NA I took Jonathan Rockway’s Catalyst course. He pointed out that the book that was printed was far different from the manuscript he delivered to the editors. He was very displeased with the job they did.
The slides he produced for the Catalyst course were much more consistent and comprehensible than the book, I think.
fREW, I think you may want to make more explicit that you’re talking about the brand new Catalyst book by Kieren Diment, “The Definitive Guide to Catalyst”. Bob and Joe, you’re not talking about the same book at all, but rather a book from a couple years ago; the new book isn’t by Jonathan Rockway.
On the Moose theme… we’ve just turned the Moose manual into a printed book (or PDF) with proper typography. Easier to read than the HTML version.
http://www.lulu.com/content/paperback-book/moose/7406976
Nice write-up and review. Greatly appreciated.
MVC Catalyst I liked, a very good framework
Leave a reply