Although I’m not the Head of Development at Primate (I’ve got plenty of other things to keep me busy), I was a developer and web programmer for many years and it’s still something I find hugely enjoyable and a valuable skill I never want to lose. Aside from the fact that actually being able to program competently is a huge advantage in understanding the technical needs of clients and the general operation of web systems, it’s also a great way to keep up to date with the rapid developments that bombard our industry. Plus, I’m also one of those people who has to know everything about everything and I don’t feel comfortable until I understand something enough to the point of being able to break it down completely and rebuild it from ground up. Until then, I just worry like hell.
Anyway, as our company is a Ruby on Rails (RoR) development house, I’ve recently taken it upon myself to buckle up and learn Rails myself. Partly this is due my unrelentingly fear of anything I don’t understand (see above), partly because it’s going to really benefit us to have another proficient part-time developer on the team (that would be me) and also partly because I figured it would just be a heck of a lot of fun.
The transition from PHP
As someone who’s been programming with PHP for over six years, I was a little anxious about the shift into not only a new web framework, but a whole new language (Ruby). Would I be able to cross train? Would I manage to get to grips with the new syntax and development style? Would I even like it? Turns out all of those concerns were unfounded.
Some of its features, such as a database migrations, are also mind-blowingly good.
Although the Ruby syntax is certainly very strange to a diehard PHPer and some of the things in it are a little weird to get to grips with (I still don’t fully understand symbols yet) the core basics of Ruby on Rails are actually very easy to pick up. I can’t say I’m massively experienced in MVC frameworks but I’m familiar with the concept and have worked with platforms such as CodeIngiter and (shudder) Symfony, something which no doubt made my transition a little easier.
Perhaps the strangest, and most pleasantly surprisingly, thing of all though is the small amount of code you find yourself writing. In fact, as someone who’s used to working with older PHP systems, it was a downright shock not to have to manually add fields to database tables, corresponding properties and Get and Set methods to a class, and then manually update a form with the right code and markup. I know, of course, that plenty of PHP MVC frameworks out there cut that overhead down considerably but even great ones like CodeIgniter still seem to require a lot of code writing when compared to RoR. I’m not sure I’m ever going to get used to it.
Ultimately, if you’ve never used a MVC web framework before you may struggle with RoR but if you have I think you’ll be in for a real treat, discovering something that’s very natural and intuitive to pick up and quick and easy to get stuck into. Some of its features, such as a database migrations, are also mind-blowingly good.
Built for web
Ruby on Rails is a very modern and purpose built web framework and soon after first using it that fact becomes incredibly apparent. It’s built for the web. Yeah, I know that’s a slightly moronic statement considering all web languages and frameworks are but somehow RoR manages to stands out from the crowd by offering functionality and features specifically designed for a web developers life. Gems, its kind of version of plug-ins, database migrations and integral compatibility with services like GitHub and Capistrano just make perfect sense in the web industry and help deal with the issue of constant, small tweaks or continually changing specifications.
This agility is no doubt a big reason why the web community has embraced the framework so much. It’s speed of development, whether it be from command line file generations or the small amount of code required to perform actions, makes RoR incredibly agile and flexible to develop with, perfect for web systems where the requirements are often constantly in flux. Instead of being resistant to changes and alterations, changing and adding functionality becomes a lot less of a chore and a lot quicker to accomplish. For instance, adding a new field to a database and form becomes a moments work rather than a laborious headache.
there’s a reason why sites like Groupon and Shopfiy are built with Rails and why it’s the favoured language of new Internet start-ups
Is it for everyone?
As much as I love Rails and would like to endorse it for everyone to use, the pragmatist in me realises that it’s not a simple undertaking to just switch from years of PHP or .Net development to a new language and framework. Indeed, in some cases it may be completely impossible or at least too hard and time consuming to justify the benefits RoR may bring. Plus, in the world of open source CMS’ and blogging platforms, PHP still has the edge and I can appreciate that it’s not always practical or money efficient to ditch these systems, especially when RoR doesn’t have the same out-of-the-box platforms to compete. And let’s not forget that PHP has some decent web frameworks of its own.
Obligatory diplomatic statement out of the way, I really need to end by saying that Ruby on Rails is a terrific framework and I’ve had a hugely enjoyable time learning it. It frees you up from writing endless boring repetitions of code and lets you focus on the stuff that counts – functionality, testing, usability – all the things that take an app or site from good to great. It also makes a whole lot of business sense in a lot of cases because its agility and rapid speed of development allow you to put together functional systems in a short period of time with lower overheads, meaning smaller investment and larger profit margins. At the end of the day there’s a reason why sites like Groupon and Shopfiy are built with Rails and why it’s the favoured language of new Internet start-ups.