Sat, 29 Nov 2008
Decisions decisions!
Well time to explain why I prefer Merb to Rails.
If you are someone that uses Merb already, then all of this will be old news to you. For the rest of you keep reading.
Well merb’s tag line is, “Everything that you need, nothing that you don’t”, and me being an economical person I like the way that sounds. Rails doesn’t have a tag line like this that I know of, but if it did it would be something like, “Everything we have, even if you don’t need it”, or something like that I’m sure.
Well as rails developers know, rails is a all encompassing framework. You get everything you need to do everything you need to do. And by default you are not given a choice, you are told you will use ActiveRecord, you will use ERB, you will use prototype etc. But what if I don’t want to use ActiveRecrd, ERB and prototype? What if I am a Datamapper, HAML, and jQuery man? (which by the way I am), what then? I tell you what, you have to get a plugin that hacks away at the core of rails to make it behave the way that you want it to do. It’s like trying to get a wood square peg in a round whole. You can do it, but you have to hack away at the peg a bit first. And what happens if the rails core is changed? Because you have hacked away to make your tool fit rails, there is no guarantee that it is going to change in a way that allows you hack to work. Oh no, I guess it is time to get that chisel out, more hacking is needed.
After a while you might get tired of all that hacking and need some time for all the blisters on your hand to heal from all the hacking. You might think, “I wish it were all easier, I wish they would just give me a choice and stop making me hack all the time”. Well if this thought sounds familiar to you, then you need MERB! Yep I said it, you don’t just want it, you need it. Why? well Merb is agnostic everything. “Whoa there”, I hear you say, “agnostic everything, doesn’t that mean that I will have a lot of work setting all the different parts to work together? That sounds like a lot of work. Maybe I would be better off going back to hacking”. The answer is while you have to do a little be more work to set Merb up, it means that you have a system that is truly flexible, can be used with or without an ORM, can be bent molded and flipped into many different types of configuration. And the best part? No hacking. Merb was built with flexibility and adaptability in mind, so it wants you to do all these things. And when they change Merb, you can be sure that what you have done won’t break without good warning, because it is built to so that no matter what they do, their public API for developing plugins will always be backwards compatible. And if they change something that won’t be, then they will give you plenty of notice about it.
Among other things, Merb is faster, lighter, more flexible, more developer friendly than rails, and all this will a whole lot less magic that you get in rails. So you won’t find yourself scratching you head wondering how things are done. You will know!
So these are just some of my motivations for using Merb for my personal projects now. And now that Merb has reached 1.0 everything’s a go!
Reading this you may think that I hate Rails. Far from it. In fact I credit Rails with reviving my interest in computing at a time where I was so fed up and bored with it all that I wanted to quit the industry altogether and do something completely different. And for what it does Rails is excellent. And if you are someone that fits into that ‘Rails way’ mold then Rails is excellent. But if you are not and you want to deviate from the well trodden path, I feel Rails is too ridged. So I say if you will utilise all the parts of Rails i.e. ERB, Prototype, ActiveRecord then by all means use rails. But if not then you should use Merb. No point trying to make a square peg fit a round hole, better to be able to pour water which will mould to the shape of the container, Get it? Think of rails as a single lane road and Merb as a multi lane highway. Both may get you to where you want to go, but one will give you only one route there, while the other gives you many paths you can take.
For those of you that think, “well Merb is small scale compared to rails”, or “No one uses that”, or “where are the example big websites that use it”. Just think that all the same things were and have been said about rails at one time in the past, and if they gave up on it because of this you wouldn’t even have rails today. Just imagine!
Oh and one last thing, I will be starting a blog called http://merbivore.ivercore.com it will be where I will express the merbivorian in me.





