Notes from Rewriting/Porting Webapps to New Frameworks Discussion
BarCamp San Francisco, June 24,2006
3:15 pm, Presidio Room
Todd Davies, session host
I wrote this session into the schedule with the above title, with the tagline "(e.g. PHP -> Rails or Django) Share your experiences and knowledge". About 7-8 of us talked for 90 minutes about this topic. I'm a designer who has been working with student developers on Deme (pronounced "Deem"), a web-based platform for online deliberation (hosted at Groupspace.org). We are tentatively planning to rewrite the code for Deme in a framework such as Ruby on Rails, from its present implementation in PHP. I wanted to hear from people who had migrated to Rails and/or knew about Rails and other frameworks such as Django, Turbogears, Symfony, CakePHP, and Zope.
I learned a ton from the participants, including Greg N., Ranvir, Chris L., John, and dotBen. There was a lot of Rails expertise in particular around the table. It was a long discussion, but here are some of the claims people made. I don't vouch for the accuracy of what's below, but I did try to pick the most credible points based on my (very limited) current knowledge of Rails. Feel free to add comments, corrections, etc. These are pretty raw.
Mail handling is good in Rails: Action Mail, IMAP.
New server Mongrel (and Mongrel cluster) is good, alternative to Lighttpd. "Lighty" is much better than using Apache, and WEBrick is like a toy.
Check out the new O'Reilly book on RJS (a $10 pdf on the web). RJS is amazing, incorporates stuff from Scriptaculous.
In some cases direct use of SQL is better than object relational mapping in Rails, e.g. when a keys table can be used to create quick lookups across different tables. John gave an example in which a simple query lookup in an optimally structured MySQL database would be done inefficiently if one defined the data model as Rails classes. The lesson is that you need to know about databases, or Rails will cause you to write inefficient code. This was one of the main critiques of Rails - that it could lead inexperienced programmers who don't understand things at a deeper level to write bad code. The good news is that Rails will let you write tables directly.
Development environments: Textmate on a Mac, Radrails on Linux or PC are both good. For installing on a Mac, Locomotive is best for getting started, but can't update it using Gems, so best to build from source - see web tutorial mentioned in the Agile Web Dev in Rails book.
Other cool stuff: dynamic finders, duck typing, the Rails Recipes book, Nitro.
Need to read both main Rails book (Agile Web Dev in Rails) and Ruby for Rails, can read concurrently, to understand Rails really. The Pickaxe book is a good reference book.
Tests for RJS - use "respond for" to get RESTful.
Recent podcast from Bruce Tate says Rails "has crossed the chasm", meaning that it has staying power, is safe to recommend as being likely to be around in 5 years.
Can forego the view stuff in Rails if app requires a custom interface, and just use Action Pack plus Active Record and get a lot of benefit.
dotBen - critic of Rails - thinks Rails tempts programmer to use defaults that are not ideally suited to one's application.
Rails teams empirically never need to be larger than 10 developers, because development is so easy.
Good thing about Rails is, in a couple of weeks, you can go a long way with it and find out if it's right for your app.