logo

 

     
 
Home
Site Map
Search
 
:: Bitwise Courses ::
 
Bitwise Dusty Archives
 
 
 

rss

 
 

ruby in steel

learn aikido in north devon

Learn Aikido in North Devon

 


Section :: Features
- Format For Printing...

Ruby Off The Rails...?

The pros and cons of simplicity
Wednesday 31 January 2007.
 

There is something scary about the Ruby On Rails phenomenon. Browse through some of the Ruby On Rails forums and newsgroups and you’ll come across hordes of self-proclaimed Rails ‘experts’ who haven’t a clue how to program Ruby. Stranger still, many of them treat Ruby as an irrelevance barely worthy of consideration.

How can this be? How can it be possible for ‘developers’ to know little about the art of programming and next to nothing about the programming language in which they claim to be ‘developing’?

The answer can be stated in one word: Rails.

Rails is a ‘framework’ that helps in the creation of interactive web-based applications. It does this by constructing web pages in response to user interaction. When you need to interface with the database or with the web page or do any sort of programming ‘behind the scenes’, you will need to write code in Ruby. So it might seem paradoxical (terrifying even) that so many people are creating Rails applications when they don’t understand Ruby!

Look, Ma, No Coding!

Before I go any further, let me say plainly that Rails is a clever, innovative system and there is no doubt of the considerable programming skills of its creator, David Heinemeier Hansson. But - ah, and here my heart sinks – Rails has to accept some (most) of the blame for encouraging the current plague of ‘Rails developers’ who can’t program.

This has all come about as a side-effect of what might sound like an entirely laudable ambition – simplicity. In the pursuit of simplicity Rails has given the complex Ruby language (and, in spite of first appearances, do not be deceived – Ruby is a complex language) a ‘makeover’ – it has smoothed out its wrinkles, powdered over its freckles and tied up its loose ends. Often it has taken features of the Ruby syntax and disguised them to look like something else.

Let’s take an example. Rails projects typically contain lots of little two-word ‘commandlets’ - like this:

has_many :comments

or

belongs_to :post

These express relationships between different bits of the Rails application. The example above is taken from a Blog demo. A class, Post, declares itself to have a one-to-many relationship (has_many) with its comments. A class, Comment, has a unique relationship (belongs_to) with a post.

So far so good. As long, that is, that you understand what a class is, can see that has_many and belongs_to are methods and that :comments and :post are types of ‘symbol’ (a symbol being a special type of Ruby object) which here are passed as arguments to the methods.

Unfortunately, many Rails developers don’t understand any of that. They enter code (and some people actually think this is a good idea) as though it no more than sequences of key/value pairs in some kind of configuration file.

With so wayward an idea of what’s going on, it’s no wonder that there are so many Rails developers and yet so few Rails applications in the world today. No doubt we’ll be seeing more in the years ahead. But I have a horrible feeling that Ruby On Rails will attract innumerable people of the self-proclaimed ‘hacker’ persuasion.

In short, Ruby On Rails is a clever and powerful system which, in the wrong hands, is a disaster waiting to happen. Unfortunately, it seems that the wrong hands are precisely the hands that are, to a large extent, clamouring to use it.

See also: Ruby On Rails - The Ten Minute Expert

More on Ruby at the Ruby Language site…
- http://www.ruby-lang.org/en/
More on Rails at the Ruby On Rails site…
- http://www.rubyonrails.org/


Huw Collingbourne is co-developer of the Ruby In Steel IDE for Visual Studio 2005

AddThis Social Bookmark Button

Forum

  • Ruby Off The Rails...?
    1 February 2007, by Mike Woodhouse

    I can’t decide if there’s been some petard-hoisting activity within the Ruby world or not. The thing is, Ruby is held up as a kind of poster child for Domain Specific Languages (DSLs) and I suppose Rails is in large part a DSL. So the fact that one can hide so much essential Ruby-ness within Rails is pretty much inevitable.

    That said, it’s probably not a good thing that the "has_many :stuffs" brigade are so effectively insulated from what’s beneath, in the same way that it was never a good thing that so many "Excel/VBA developers" were ignorant of stuff like "Option Explicit". Or classes.

    I don’t really see a fix for it.

  • Ruby Off The Rails...?
    1 February 2007, by Brian Wisti

    I think you pegged it. Ruby on Rails is good, and DHH’s self-promotional skills are awe-inspiring. But Ruby itself is getting shuffled to the back by a lot of newly minted Rails Developers who only know that Rails is written in Ruby - and don’t care to know more than that about this lovely language.

    Time will tell if that’s actually a bad thing. Plenty of folks use Emacs despite having no idea how Lisp works. Maybe the Rails approach of minimizing the need for fresh code will end up freeing developers to write even more interesting and powerful Web sites.

    I’m skeptical, though.

    • Ruby Off The Rails...?
      1 February 2007, by Branden

      Why is this bad, again? You seem to think that reducing the learning curve is a bad thing?

      Quite the contrary, I think that its a great system for the n00bs out there. Sure, they may not understand what blocks, iterators, or continuations are, but they will have to learn about relationships between database tables and MVC principles. These are skills they can take to ANY language, whether they ever learn a lick of ruby or not.

      Furthermore, I’m yet to see any compelling uses for Ruby outside of hobbyist coding and other web app frameworks (like Camping). In my opinion, learning enough Ruby to do Rails is a pretty good accomplishment for a beginning programmer, and Rails is inspiring lots of great online resources for people who want to pursue Ruby further. Just my two cents.


Home