Though you hear it all the time, comparing Ruby on Rails to PHP really is not fair – they are different animals entirely, only sharing the goal of creating websites that do stuff.
Ruby is beautiful, elegant and easy to read. PHP is pragmatic and direct but disorganized (imho).To Ruby, everything is an object, which serves as a good organizational mechanism. In PHP everything is a global function, usually with funky names that give little indication to what it does. It is like the difference between an organized toolbox, with all the right tools in all the right places and one big box with all the tools thrown in haphazardly.
Let’s look at a overly simplified example of some Ruby code, often used in Rails.
What do you think that means?
Let’s look at it in PHP.
time() – 86400;
Hmm, I think most of us could figure out the PHP but anyone could read the Ruby. Which brings up another subject. The Ruby code above is actually an extension of a core class/object in Ruby, which Rails does – a lot, to great effect.
There are many more/better reasons for choosing Ruby and Rails, of course. But, for me, it is the simple things that Ruby allows which makes Rails … different and better.