Ruby on Rails – a real gem
Last night I got back from a friend’s bachelor’s party only to discover my better half performing a topological improbable feat: with all of her 1.59m (5.2foot) she managed to somehow place her perfect body on our 2.10m by 1.60m bed in such a way that I would not have any place to lie down where all my body parts are placed on the mattress. I bet Dijkstra would love to see that in action.
That served as a perfectly sound excuse for sitting at the computer at 2am, wading through the endless picture stream of flickr. Since I wasn’t drunk enough - I developed the urge to write a little web program that will use flickr API to search through flickr for all pictures tagged with a specific term, and then post the set of pictures results to a blog using the Blogger API .
I then came across flickr.rb – a ruby interface to Flickr. One thing led to another, with a little help from RawSugar search I have found this great ruby on rails tutorial from the wonderful people of ONLamp.
Now, I’ve seen a framework or two in my life, but it has been quite a while since I found myself laughing at loud with great joy seeing how easy it could be to develop a web based applications. It was even more pleasant to see that an “inherently complex” problem is solved in such an elegant way just by keeping the number of problem variables to the minimum by using convention over configuration.
The same principals that make UNIX an incredible operation system for programmers are used by Rails to make it an incredible framework for web application developers: Connecting many small & simple components through a convention-based scheme to create a powerful, flexible, extensible and timeless system. KISS and all that jazz.
It reminded me of the MAGIC application generator. By using it one can develop a database application quickly and bug free. The secret is that the program flow is fixed (predefined) allowing well defined extension points. That’s the approach with Rails also – everything is nailed down for you – from the file structure up to database interaction, you just write the real important stuff. It is easy, fast, rewarding, and produces higher quality code.
It felt like being 9 years old again, discovering the power of the Plot and Draw commands in legendary ZX Spectrum’s genius basic.
Let me finish off with a couple of Dijkstra's quotes that appear in Wikipedia’s article referred above:
- "The question of whether a computer can think is no more interesting than the question of whether a submarine can swim."
- "Computer science is no more about computers than astronomy is about telescopes."
Tags: programming, ruby, rails