Should I learn Ruby on Rails...part 1
Ruby on Rails (RoR) has been on the radar for me for a long time now and after seeing a recent infographic highlighting the high percentage of applications built with it, I decided 2013 would be the year for me to take a good look! My experience with frameworks is very much PHP focussed, having used CodeIgniter to build a few web applications including a Project Management app and a simple Estate Agent property management system. I'd say that I'm a big fan of CodeIgniter and although I'm always reading about how it has many 'limitations' I've never come across anything it couldn't handle. So here are my first thoughts about Rails and so far I'd say I'm not that keen.....yet
Some bad stuff...
Takes a long long time to get your environment set-up before you can get coding
I was quite astonished by the time it takes just to get your computer set-up and ready to start coding. Whilst there are some fairly good tutorials of what to do, they all seem to be slightly different and all have there own quirks. You're required to install Ruby, RVM, Ruby Gems, Rails, Git(Sign up as well), Heroku(sign up as well), to name a few. I then had countless problems at each stage, requiring more google work to find out what was wrong etc etc. Maybe I've been spoilt with the ease of getting started with something like CodeIgniter but this kind of laborious set-up really put me off.
Everything just seems to 'work' without any clear understanding why
I'm one of those developers who likes to understand clearly what is happening and why. RoR just seems to handle all sorts of stuff without making it clear exactly what it's doing. Take a connection to a database, it just works, no config, it's just connected. In some ways this is great and maybe once I've dug a little deeper it'll be clearer what's going on. However I like to have control, purposely making things happen, rather than typing a block of code into the console and 100 things happening automatically.
Steep learning curve
The Ruby language is just damn right strange, it's all over the shop in my opinion. I'm sure many seasoned Ruby programmers will disagree with me but pretty much every tutorial I've worked through so far has backed this up. I'm not doubting it's power for one minute but to me the syntax is just odd and I'm yet to get my head around it. PHP is just far easier to get your head around. The other point is that the Ruby community support is good but it's nothing compared to the online tutorials and resources you get for PHP. If you're going to check RoR out though, I'd definitely recommend http://ruby.railstutorial.org it's the best Rails tutorial I've come across so far.
Doesn't seem to be that easy to deploy without in depth understanding
Launching a PHP based application is pretty simple. You have a bunch of files that you can FTP to your server and away you go. Rails seems to be far more complex and again doesn't make it particularly clear what is going on. I've been using Heroku, which seems to try and make things quite simple but it just never is. Almost every app (very simple apps) I've deployed, it's not worked remotely in the same way it has locally. The error logs produced seem to be next to useless with error H10 - App Crashed being my favourite so far.
Some Good Stuff...
Test Driven Development
Ruby on Rails has been built with Test Driven Development at its core, something that is certainly lacking and not as easy to achieve in the CodeIgniter framework. Although I don't fully understand it yet....the ability to set-up and run various tests, right from the start is very good indeed. It encourages quality development and will save countless hours debugging silly errors.
Pre built gems ready to add straight to your app
If you head over to http://rubygems.org you can access pretty much every required piece of functionality you could imagine for your app. Take sign in/out authentication, something that I would usually build from scratch in CodeIgniter. With rails you can download and install pre built authentication, ready to customise as you see fit.
To me, these are kind of good and bad. It's great that with a couple of simple commands you can get a whole lot of functionality ready to start working with. It can speed up the process of development and sometimes for a new person working with the framework, it provides a good foundation to start playing around with. However, I think it encourages some very lazy development and again creates things without giving you any clear understanding of what is going on.
By no means am I done with Rails, I'm about half way through the video tutorial pack I got from http://ruby.railstutorial.org and I intend to finish that and provide part 2 to this post. I'm under no illusions that learning a new framework and language is an easy process. I'm just surprised that so many people talk about how easy it is which has distorted my opinion. It's not easy, not by a long shot and will take a lot of hours and hard work to really get your head around. I intend to put in those hours and then make a decision to see if this is something I should pursue.Tweet