Wednesday, February 20, 2008

I hate Rails

I hate Rails! When Rails was introduced to me I thought, "Hey this is great!" I had already been using Ruby and I LOVE ruby, really way more than I should. So I had the idea that a framework based on Ruby had to be wonderful and sure enough read the posts all over the web. Rails saves baby from Fire! Rails finds cure for cancer! Rails brings peace to the middle east!

Except that Rails is nothing like Ruby, Rails is a regimented my-way-or-the-highway type of system, yes you can change it, if you become a Rails expert. If you encounter problems with your app debugging is a pain, have a rare problem with an app and the frustration that you will face before getting an answer...bahhh!

This is not why I hate Rails though, this is why I decided that Rails is not for me. Other people use it and think it's great and it seems to fit their needs which is great for them, but that doesn't help me much. So I move on, I know PHP and it is a great language and it works well and is widely supported, but it's not Ruby. The elegance of Ruby gives me a great deal of pleasure, I really enjoy writing Ruby scripts, I am not that good at it yet because I need scripting for webwork and this is the seat of my problem, this is why I hate Rails.

If you are familiar with Ruby or Rails etc you probably are already thinking, "Why doesn't he just use eRuby and shut up?"(Actually if you are like a lot of Rails programmers it is more like, "Why doesn't he just use Rails and love it?") So anyway, I would love to use eRuby. That is what I was looking for, it is not as mature as PHP, but since it uses Ruby I will overlook the little bit of extra work I have to do to get the same results that I could get with PHP. Except, mod_ruby is as flaky as hell. It works for some things rather well, but according to hundreds of people that have tried it and posted about it and my own personal experience. It just doesn't play well enough to be useful.

For example, I was set mod_ruby up on my LAN server, with eRuby and started happily writing RHTML files and everything was grand, I was teaching my kids how to us it and they fell in love with Ruby and we were having a ball with it. Cut, fast forward a few days. The kids are interested in writing some web apps to actually deploy on the net and so we decide to build a forum together using eRuby and MySQL. So as I show the kids how to connect to MySQL using eRuby <% require 'mysql' %> and...apache can't find it --- require': no such file to load -- mysql (LoadError). So I go into irb and require mysql and it works no problem, hmm well of to google it and see what I am doing wrong...

Except for about three sites (http://mod_ruby.net, http://www.hiveminds.co.uk/, http://pleac.sourceforge.net/pleac_ruby/) there is just nothing out there. Oh there are lots of people asking similar questions, but the answers tend to be, "Just use Rails". Heck you can hardly find anything to do with Ruby any more, search for ruby get drowned with Rails, search for eRuby, get drowned with Rails. This is why I hate Rails, it has become the default for Ruby lovers and you can get in lock step and start cheering or go back to PHP or Python. As far as I can see Rails originally helped showcase Ruby and did a lot of good in marketing sense to help drive Ruby adoption, but now it is starting to seem like it is the albatross around the neck of Ruby and it is going to drag it down into the depths.

Rails is not good for shared webhosting and most higher volume situations, it is hard to deploy (yes it is easier than before, but still ridiculous) and way too complicated for casual users to pick it up for anything truly custom. if you look around you will see comments similar to mine about Rails and calls for a better mod_ruby, something similar to mod_php. The thing that blows my mind is the amount of argument saying things like, "PHP is only easy to deploy because it is so insecure.", "We need a model that runs outside of the web server to retain security." WTF? OK everyone off the net, all these sites that are PHP powered are too insecure to use, time to shut them down.

This ivory tower mentality is the core of the rot that is going to kill Ruby. PHP got to where it is today because it was designed to be useful, first and foremost. What a concept, first make it useful, then deal with any other issues, because frankly if no one will use it then it will be as secure as it gets because it wont be on a server exposed to the internet.

No comments: