A few months back, shortly after my last post, I had a what-if-why-not moment.
The what-if was on my choice of the language - PHP, so seemed to go the opinion online, was struggling under the weight of its own inconsistencies. Too flexible to be held to a particular convention, too popular to have one decisive framework that would address all of its supposed evils. As must be pretty obvious, most of the people making these claims were Ruby-ists. Ruby-on-rails was the Promised Land, keeping you on track with development and taking care of all the other nasty stuff that us developers have to deal with. Especially the little things that you wished you didn't have to deal with.
Why not, I wondered then? If - despite the challenges of picking up Yii - I were to opt for a framework anyway, why not in a new language? Moreover - if reports are to be believed - Rails developers are rarer than PHP'ers, and therefore an average Rubyist earns a wee-bit more than your slightly-above-average PHP programmer. The clincher was the fact that Rails and PHP are among the most popular languages when it comes to web applications (and my experience as a user of ASP websites has left me in no doubt whatsoever of the migraine awaiting me if I were to choose Microsoft's problem to all solutions).
I decided to give Rails a try.
Picking up Ruby and Rails...
RubyMonk and CodeLearn were two tutoring resources I found extremely useful from a newbie's point of view. While RubyMonk helps you pick up the basics (and a bit more) of Ruby rather effortlessly, CodeLearn's assignment - creating a to-do list application from scratch - does what it should, which is to ease in a coder into the world of Rails programming. I did try other places like CodeCademy, RailsForZombies, etc., but the takeaway from those sites were lesser in comparison.
From the very beginning, one of the things that's struck me about Ruby is its simplicity. Having learnt the lessons from the time I started on PHP, I looked around for a ready-made stack that would give me Ruby/Rails, MySQL and a web server. BitNami - Ruby's equivalent of (W/L)AMP - was a breeze to set up, although running both BN and WAMP on the same machine had its gotcha! moments. You don't need a stack to install and run a Ruby compiler on your machine, though, and if it is a CLI/GUI application you are coding, you can download Ruby right off the site and set it up on your machine.
Over to RubyMonk then. C42, the team behind the tutorial, has done a great job in breaking up the entry to Ruby into a series of small, manageable, memorable steps. Each chapter unveiled a feature of Ruby that appealed to me - and in comparison to PHP, seemed much more organized - and the interface was as fast as if it were run locally.
Interestingly, there were a lot of hints, something I found sorely lacking on Zombies, and in certain instances, common errors were actually explained back to me. The one limitation was the absence of a Rails tutorial (which they have started only very recently, and is therefore not developed to the extent of CodeLearn) As a fan of the Kung Fu Panda series, I liked how they have Shifu sitting in his temple and teaching us the secrets of Ruby Fu.
Interestingly, there were a lot of hints, something I found sorely lacking on Zombies, and in certain instances, common errors were actually explained back to me. The one limitation was the absence of a Rails tutorial (which they have started only very recently, and is therefore not developed to the extent of CodeLearn) As a fan of the Kung Fu Panda series, I liked how they have Shifu sitting in his temple and teaching us the secrets of Ruby Fu.
Speaking of CL, they have recently revamped their website and it looks much better now - more organized, and gives you a better sense of the tools that you have to work with. At the time I used their tutorial, the console was virtually non-existent, but the explanation - spread over a five-page tutorial - was bang-on. The explanations for the MVC architecture, something I had struggled with until then, was reminiscent of the 'For Dummies' series and has probably shaved a few weeks off my learning curve.
CodeLearn's course takes you through everything from setting up a new app, folder structure, loading Gems, cranking up the server, etc. - making it easier for an experienced to programmer to identify common grounds and points of difference, and build from there. The new sandbox, with its own console, file browser, web browser and code editor, is a far cry from a recent time when the tutorial was more of a walkthrough that you implemented on your own machine.
Ruby, to the aspiring, ranks especially high on one aspect. It builds in a unit-testing functionality that PHP is only waking up to. Unfortunately, this is also an area where there are more theoretical tutorials than live-coding ones as above.
In recent times, along with RubyMonk and CodeLearn, most of the other e-learning sites for RoR have expanded their content and/or revamped the user-experience, but I would still recommend these two sites for a newbie who's looking to test these waters. Not only are the courses free, but also is the learning curve much easier to handle.
At the same time, be warned that they might still be underwhelming to someone who's spent at least a year with the framework, and for those users, RailsForZombies might be a slightly better bet. Then again, nothing beats sitting down in your own pit and trying to make a castle with a spoon and a cup of water, and you would be amazed at what you learn when you don't have a ready-made solution right in front of you.
(Next part, appropriately enough, will be titled 'Getting off track with Rails', and as the name suggests, will explain why I reverted to PHP as my preferred language - at least for ver 1.0!)

