Book review: Agile Web Development with Rails

28 12 2005

Agile Web Development with Rails, by Dave Thomas, David Heinemeier Hansson.

Book coverRails, or more appropriately Ruby on Rails is the new web application development framework that everyone is so excited of and raving about how it cuts development time by a factor of 10 and does away with the cumbersome XML configuration files that are the hallmark of J2EE.

Being an old Java hand, I wanted to see firsthand if there was some substance beneath all the hype. I was also intrigued by the fact that many other old Java hands whom I respect and admire, like James Duncan Davidson, Elliotte Rusty Harold, Bruce Tate, Graham Glass, and Brian McAllister are now fervent (to different degrees) rubyists and Rails-enthusiasts. If it weren’t for them, I would never have undertaken this journey, probably.

But anyway, this is supposed to be a book review, not a chronicle of my ongoing discovery of Rails.

I mostly like using books to discover and learn about new technologies, so it’s perfectly natural that I decided to take off with what is considered the book about Rails. And how could it be not, with Rails’ creator David Heinemeier Hansson as one of its authors?

It is also the only one published so far but, even though the choice was a bit, uhm … limited, I wasn’t disappointed. The book, as is customary with titles from The Pragmatic Programmers’ bookshelf, is very good. It lays down in detail almost everything you need to know to be productive with Rails, save for the language Ruby itself. To be honest, the book includes an appendix introducing the basics of Ruby, but it’s just the bare minimum. I suggest getting yourself a good Ruby book (like Programming Ruby, also from The Pragmatic Programmers, which I am currently reading and will review shortly) if you really want to get the most out of Rails.

Another caveat you have to be aware of is that Rails is a quickly moving target. The book covers version 0.13, which was current around mid-2005. There was a 0.14 version after that and we are now at 1.0, since a few weeks ago. However, I didn’t find I had much to change while experimenting with Rails following the book. As always with Open Source software, resorting to the mailing lists, forums or the #rubyonrails@freenode.net IRC channel is the best avenue for finding answers to your doubts and asking support questions.

The book is organized in four parts:

Part I introduces the design principles behind Rails, its most important concepts and briefly covers how to get started by installing it and writing your first program. The part about installation is the one that is bound to become quickly obsolete, as new and easier installation methods for the various supported platforms are developed.

Part II dives into Rails by guiding you along the development of a real (albeit much simplified) e-commerce application. I find this approach to be very good and “pragmatic” indeed. Of notable interest is the chapter on testing. It’s great to see that providing a good test scaffolding was one of the main design concerns in Rails and not just an afterthought.

Part III goes deeper into Rails and can be used as a reference for its components, like Active Record, Action Controller, and Action View. Bonus chapters on AJAX, Web Services, security, deployment and scaling issues are included here and will make the book even more valuable when you need to deal with “real world” applications.

Part IV contains the appendices, like the above mentioned introduction to Ruby, a reference of configuration parameters (be warned again: these might change), the full source code for all samples (of dubious value, in my opinion), and a list of online resources (once again, a list bound to be more and more incomplete as time passes and the excitement around Rails grows).

Overall, I find the quality of this book to be excellent. It’s not thick to the point of being too heavy to carry around in your laptop bag, for those times when you need to peek at it, yet it covers enough of Rails to be considered a complete and authoritative reference. This is probably a testament to Rails’ simplicity too.

The writing style is eminently readable. You can read it cover to cover, if you like, without getting bored. The frequent sidebars make it lively without being too distracting. A great amount of care and craftsmanship went into producing this book, and it shows.

Highly recommended!





Book review: "Practical Subversion"

6 12 2005

Book CoverPractical Subversion, by Garrett Rooney, Apress

I picked up this book because, after having worked for a long time with CVS as my only source control system, I moved to Subversion and needed to acquire a deeper knowledge of it (Incidentally, you would be crazy to still use CVS now that Subversion is stable and freely available). And deep does this volume go indeed. It’s written largely from the perspective of a repository administrator or a power user wanting to extend the system and develop new applications on top of it, as the long (73 pages) chapter on Subversion APIs demonstrates.

But even if you are a developer wanting to know more about Subversion because your company or favorite Open Source project just standardized on it, you’re bound to find a good deal of useful information in it. Just don’t think to be able to understand everything is you’re totally inexperienced when it comes to source control systems. In this case, I’d suggest “Pragmatic Version Control Using Subversion” as a more accessible alternative.

The introductory chapter (A Crash Course in Subversion) and the Best Practices chapter are very good even for beginners, anyway.

The writing style is clean and linear. Typography is good, apart from the horrible font used for the headings and the table of contents.

In conclusion, I don’t think you can find anything better, either online or in print, if you really want to make the most out of Subversion, so I give it five stars. The fact that it is not an introductory text should not detract from this judgment but, as always, caveat emptor.





The Fog Creek reading list

23 11 2005

Joel Spolsky: “The management training program we’re starting up here at Fog Creek will take about three years and will be relatively intensive. Among other things, there will be a required reading list consisting of about 75 books (we’re working on the theory here of one book every two weeks)”

Interesting book list. Personally I’ve read ten of them:

All of them are great books, so I think the same can probably be said of the others on the list.

Plus, I have The Search on order at Amazon, so I think I am well equipped to apply for the Fog Creek Software Management Training Program ;)





"Foundations of Ajax" review

19 11 2005

1590595823.01._AA_SCMZZZZZZZ_.jpg
Foundations of Ajax, by Ryan Asleson, Nathaniel T. Schutta — Apress.

The Ajax phenomenon is quite new — even though the underlying technologies have been around for years — but in a few months it’s already become mainstream. It’s still in the early-adopters, pre-oreilly-book phase, but some books are already starting to appear. Kudos to Apress for being able to publish a quality product so early.

This is really a foundations book, as the title says. It does a good job of explaining the underpinnings of Ajax, even though the initial chapter on the history of the Internet could have been edited out without much harm. It explains very plainly and clearly the basic Ajax techniques and presents a good overview of some of the best tools available to the Ajaxan craftsman.

Being an introductory text, you can’t really blame the authors for not going too deep into the most complex technical and architectural issue. However, if you already tried doing some simple Ajax applications, there’s not much here that you haven’t probably already read somewhere else. To be honest, there’s a good number of hints, tips, and tricks and many pitfalls are dutifully pointed out, but you are left wondering whether there a more systematic approach wouldn’t have been better suited.

This is the main defect of the book, in my opinion. It feels rather disorganized at times. There just doesn’t seem to be a linear progression from the basic to the more complex issues. Some subjects are barely skimmed over whereas for others (the Venkman debuggers for instance) there’s even too much detail.

In particular, the final chapter on Ajax frameworks would have been great if it hadn’t dedicated just a few lines to each framework.

If it were not for this, I would have given “Foundations of Ajax” a five-star rating. As it stands, it’s only four.





"The Best Software Writing" review

10 11 2005

1590595009.01._AA_SCMZZZZZZZ_.jpgThe Best Software Writing I: Selected and Introduced by Joel Spolsky

The blurb on the back cover reads:

At my own company, we instituted a policy: we only want to hire software developers who can write, and write well. Just try submitting a résumé to me with grammatical errors or a cover letter that reads like it was written by that guy who translates those instruction manuals for really cheap consumer electronics. I dare you.

I think this is a great policy. Being able to communicate well is one of the greatest and most overlooked assets to look for in good software developers. With this book, Joel Spolsky shows us some of the best examples of good writing in the field of software.

If it were just a matter of good writing style, the importance of this book would be rather limited. But its real value, besides the stylistic aspect, is the great content. Most articles are not just well written, but also very interesting, insightful or outrightly funny. Great content in a nice package.

I’ve previously referred to Paul Graham’s essay “Great Hackers”, which is one of the best. My other favorites are Ken Arnold’s “Style is Substance” and why the lucky stiff‘s introduction to the Ruby language.

My only small gripe with the book is the fact that most, if not all, the material inside is already available on the net. It sure is pleasant having it all nicely collected and printed in a book, so that you can read it on the plane or at the beach, but I find it quite improbable that all good software writing can be found on the net and none in print magazines and book. Or maybe it is simply easier to obtain republishing rights for online material than it is for printed stuff? A couple of comic strips seem quite out of place, too.

Apart from these minor details, a very entertaining and stimulating read. Highly recommended.





"Pro Hibernate 3" review

31 10 2005

Pro Hibernate 3, by Jeff Linwood, Dave Minter (Apress)

The good stuff:

  • Clear and consistent.
  • Very few errors (spotted just a couple, minor ones).
  • Good typography.
  • The authors know their stuff, and it shows.

The not so good stuff:

At 242 pages, this book is too thin. No, let me restate it: it is way too thin. I’m not particularly fond of very thick books, but when the subject matter is complex, you simply can’t get away with a cursory glance at its intricacies. You see, at 408 pages, I still think that Hibernate in Action, though it is probably the best book on the subject, would be just great if it packed a few more pages.

The problem with Hibernate is that beneath its apparent simplicity lie a large number of difficult problems. Don’t get me wrong, I still think Hibernate is the best ORM tool out there. Unfortunately, Object-Relational Mapping is a hard problem. Solving the Object-Relational impedance mismatch in a fully transparent way is probably impossible: all proposed solutions so far are, in the end, yet another abstraction layer. And as we all know, all abstractions leak, one way or the other.

If you are just beginning to approach Hibernate and think that you will get a decent coverage of the complexities, traps and pitfalls of a tool like Hibernate in just 242 pages, you’re bound to be disappointed. Here are just a few subjects that I would have liked to see covered much more deeply:

  • HQL syntax. The official Hibernate documentation already gives some more complex samples, but their explanation is too concise. A good complement to the docs should probably clarify what you can and what you cannot do in HQL.
  • Exotic mappings.
  • Tuning and optimization.
  • Caching. What are the benefits and drawbacks of the various caching strategies and implementations?
  • Lazy loading. It is my experience that novices sooner or later will get the dreaded LazyInitializationException. What techniques can be used to avoid it?
  • Cascading rules and their effect on the lifecycle of entities.
  • Bulk loading and saving.
  • Using versioning to implement optimistic locking.
  • Others that I don’t remember at the moment.

All in all, I don’t think this is a bad book. Quite the contrary. It’s just that I think the authors could have dispensed some more of the goodness they are evidently capable of. As it stands, you will at the very minimum need to have a copy of the official Hibernate documentation, plus Hibernate in Action, on your desk, together with Pro Hibernate 3.





"The World is Flat" review

27 10 2005

I might be treading on dangerous waters by reviewing Tom Friedman’s latest book “The World is Flat” (Farrar, Straus and Giroux, ISBN 0374292884) instead of the usual computer books. I am no economy or geopolitics expert, so I might be flamed for writing something really stupid, but after all this is my blog, so I’m allowed to say anything i like, right?

First of all, I liked the book. Not as much as “The Lexus and the Olive Tree”, which I found more varied and lively, but still I think it’s a very interesting and stimulating book.

I also do not agree with some of the critics, who pointed out that the world is still round and that there are many inequalities yet. To say so is to overlook the fact that Friedman himself admits (p.375: “Indeed, this is the point in the book where I have to make a confession: I know that the world is not flat.”) the same.

The one point where, in my opinion, Friedman downplays the risks to the flattening of the world that are brought by globalization itself, is when he talks about the impending energy crisis caused by the growing of China’s, India’s and Russia’s economy (“Too Many Toyotas”). He dedicates too little space to this problem and it is obvious that he has no real solutions to propose. But on the other hand, who has them?

As a geek and Open Source advocate, I obviously appreciate the importance given to Open Source as one of the “ten flatteners”. I would just like to object to the statement that “In 1991 [...] Linus Torvalds [...] posted his Linux operating system to compete with the Microsoft Windows operating system.” In 1991, Windows was at version 3.0: not much more than a graphical shell on top of MS-DOS and nowhere near complete dominance of the desktop market. We all know that Linus wrote Linux because he wanted a free Unix-like operating system to play with and Tanenbaum did not want too release Minix for free. I don’t think the existence of Windows played any role in this.

Apart from these minor critiques, I recommend “The World is Flat” to anyone wishing to understand where this world is going. You might not agree with everything that Friedman says here, but it will surely give you much food for thought.





Top 100 English-language Novels

19 10 2005

Today’s meme is: Indicate which books from Time’s list of top 100 English-language novels from 1923 to the present you have read. Since English is not my mother tongue, I must be forgiven if my list isn’t as complete as someone else’s.

  • Animal Farm
  • The Big Sleep
  • The Catcher in the Rye
  • The Confessions of Nat Turner
  • The Crying of Lot 49
  • The French Lieutenant’s Woman
  • Gravity’s Rainbow
  • Herzog
  • Lolita
  • Lord of the Flies
  • The Lord of the Rings
  • Neuromancer
  • 1984
  • On the Road
  • Ragtime
  • Snow Crash
  • The Spy Who Came in From the Cold

Two Pynchon’s and two Orwell’s. I don’t know if that means something.

To my personal list, I would surely add “The Hitch-Hikers Guide to the Galaxy” by Douglas Adams, “High Fidelity” by Nick Hornby and something by Robert Heinlein, Tom Wolfe (“The Bonfire of Vanities”) and Tom Robbins. Not exactly classics, though, but neither “Neuromancer” nor “Snow Crash” are.

(Via Andrew)





Astroturfing on Amazon

11 08 2005

Steve Loughran: “But wait a minute, check out those reviews. Every single one of the 5* reviewers calls it ‘ANT’, not ‘ant’, and is so full of unqualified praise you’d think this is the best contribution to Java literature ever. Yet these people have never reviewed anything else, except for some who do nothing but praise a single publisher, or cross-link to it.”

Thankfully, Amazon has put in place some methods for countering this type of behavior. If you see a “Report this” link beneath an obviously fake review, click on it and, assuming you have an account at Amazon.com, a report asking to take down the review as inappropriate will be sent to them. I guess that if enough people do this, we’ll soon see those reviews disappear.

It’s sad that a publisher like Virtualbookworm is engaging in these slimy tactics. Well, I guess they went a little too far in committing to the mission statement that is written on their homepage:

This means we are truly dedicated to the success of our authors!

Update: The saga continues. Far from being ashamed of their own behavior, those slimeballs are reaching new lows like copying the single honest and negative review they got and pasting it as if it were a review of every other Ant book on Amazon, as can be demonstrated here. Fucking spammers!

Update [Aug. 14]: Looks like Amazon took care of this, as all fake reviews (together with the only true one, unfortunately) on all books by A.T. Bell have been removed. I had also emailed Virtualbookwork.com about this and they were kind in replying promptly that is not their policy to post fake reviews and they would have investigated whether it was one of the authors. I’ll give them the benefit of doubt, even though there are other suspicious cases on Amazon yet, like books having seven or eight 5-star reviews by anonymous reviewers.





Seth's New eBook is ready

16 05 2005

knock.jpgSeth’s Blog: Seth’s New eBook is ready: “My new ebook is ready.

It’s called KNOCK KNOCK, Seth Godin’s Incomplete Guide to Building a Web Site That Works. It costs $9 and you can buy a copy by clicking this handy button.”

OK, Seth, I’m really tempted and $9 is nothing, but give us a sneak preview, a table of contents, a free chapter, just to overcome the psychological threshold and click that Paypal button ;) .

Buy now!