I often criticize products from the big vendors like IBM, Microsoft and Oracle for what I call the “New Coke Effect”. As retold by Malcom Gladwell in Blink, Pepsi introduced blind taste tests in the 80s. They beat Coca Cola by a big margin. In order to regain the advantage, Coke developed “New Coke”, a product that was optimized for the blind taste tests. It tanked. Totally. It tanked so bad that coke had to have the words “classic coke” prominently on the label until 2002.
The problem is that a blind taste test is not the same as drinking a whole bottle. People prefer sweet tastes when they just take a sip, but not when they want to finish the glass.
A lot of visually oriented software development tools are similar: They have been optimized for a 30 minute demo in front of a crowded auditorium. Sadly, many of these products are an active obstacle when you want to “finish the glass”, that is, deliver working software into production.
Ruby on Rails is different: It looks great in a demo, but it take the whole software development life cycle into account. These two facts put together is why I recommend it so much these days.
(Shameless plug: If you’re located in Oslo, and would like an introduction to Ruby on Rails: Feel free to get in contact with me).
For a full tutorial on Rails, I recommend Rolling with Ruby on [Instant]Rails, by Curt Hibbs and Bill Walton.
This week, I showed a client how to use Ruby on Rails to get started developing web applications. I felt the workshop was a fruitful one. None of the people in the room (except me, of course) had any experience with Ruby on Rails or Ruby, and some of the audience had not worked with programming at all for several years.
In spite of this, everyone was able to understand how the application worked, and how everything fits together. This is what I find to be so fun about demonstrating Rails: There are no hidden tricks. I can install everything on a provided computer and I can explain how all the pieces fit together. I can explain how to address deployment, database upgrades, layout issues, AJAX, REST-webservices, security, and scalability. This is not a magic trick to be waved in front of an audience and they quickly hide behind your back.
In a matter of a few hours, we were able to demonstrate, discuss and explain:
- Install the necessary software (Ruby, MySQL, and Rails itself via
gem install rails. Alternatively, we could’ve used InstantRails)
- Create an explore a working, simple “hello world” web application
- Use Ruby on Rails’s Migration and Scaffold to create a database table (
ruby script/generate model service_provider name:string description:text registration_date:date) and the web pages to create, display, update, and delete entries in the table (
ruby script/generate scaffold service_provider). Rails comes with scripts to create the tables (
rake db:migrate), and load pregenerated (but editable) test data (
- Create and explore a bidirectional one-to-many relationship between ServiceProviders and Customers with has_many and belongs_to
- Implement a mock-login scheme using sessions. Our login-action lists all the service_providers (using a select list). Yeah, I know it’s lame, but implementing passwords takes time, and doesn’t really prove anything.
- Restrict which Customers a ServiceProvider can see and modify (by using a before_filter and using
- Implement some validation rules
- Explore (but sadly, not demonstrate) deployment options using Capistrano
Copyright © 2007 Johannes Brodwall. All Rights Reserved.