Riding the Rails

August 21, 2007

No longer should the secret be kept from whoever is reading this: I want to marry Ruby and have its sweet, lovable babies. By the way, I’m also rather confident Ruby will think of a quick and easy way for a man to bear children, so that I can keep my promise. I mean, if it’s able to create a working blog in just 15 minutes and using just 58(!) lines of code, then this should prove to be a piece of cake.

Those of you who cared enough to visit the links above have by now probably noticed I’m talking not just about Ruby, but also (and mainly) about Ruby on Rails. First off, a bit of history to get us in the mood: Ruby was developed in 1993 by Yukihiro Matsumoto, and released to the general public in 1995. It was designed to be an elegant and easy language, which does exactly what we expect it to do; methods are named after English terms that appropriately define the action it performs.

However, it was only in 2003, when David Heinemeir Hansson, together with 37Signals looked into coding a web-based project management tool, that Ruby began to be known around the world. The reason for this boost in popularity was that Hansson, unsatisfied with the monotonous and redundant process required to build the application in PHP, chose to use Ruby instead. After the project was complete, Hansson realized much of the code he wrote could be made into a framework that could be used to simplify future projects. Thus, Rails was born.

I’ll admit I’m still way too green when it comes to programming in Ruby or getting the best (or anything at all) out of the great Rails framework, but I must say I’m impressed with the results I got after investing just a few hours in learning it.

I’m not a genius, it’s just that easy. With a few commands you can type into a console (or by using more intuitive drop-down style menus provided with the Eclipse based IDE Aptana), you can create the entire skeleton of a project, with all the files you will ever need, create platform independent database schemas, and even create an actual bare-bones web interface that allows you to perform simple actions on your tables (creating, retrieving, updating and deleting records)! Also amazingly is the voodoo magic (called ActiveRecord) Rails uses to know which database fields are primary keys, foreign keys, the kind of relationship, etc. Simply amazing! This bare-bones structure (called scaffold) won’t win any Web Design awards, that’s for sure, but keep in mind that getting all of this functionality requires only 5 minutes of your time and you’ll be converted.

Ruby, in itself, is an extremely flexible, object-oriented programming language. The syntax is pretty lax (and I mean really lax); you can end statements with a semicolon —- or not; You can write a method’s code inside brackets -— or if you don’t want to, that’s fine too. The list just goes on and on. If you’re like me, and try to get into Ruby coming from PHP, you’ll notice the differences almost immediately. Gone is PHP’s cryptic code and syntax rules. Ruby seems almost like it was built with right-brained designer types who get lost in complicated scripting languages in mind. Coupled with Rails, you can build an almost entire application from scratch and have it working in minutes, allowing you to concentrate on your design and advanced features rather than on making it “just work”.

Did I mention Rails already has AJAX functionality built-in? That’s it, I’m off to buy a wedding ring.

I feel deprived.

May 11, 2007

You guessed it. I haven’t had an Internet connection for like three days now. Well, it seems more like three years. It sucks having nothing else to do than "offline" work… or, because I don’t feel like it, just watch Anime. Well, at least, while doing so, I was finally able to start watching Bleach (yeah, I know, I’m like, a century late.) and I have to say, the show has already made a deep impression on me. I would say it carved itself on my flesh, if that wasn’t so disgustingly graphic that my own gag reflex kicked in. Problem is, I shouldn’t have really gotten so caught up in another show, since I have so much work to do during the following weeks I barely have time to watch any (there’s always room for Death Note, though). Anyway, a warning to all out there who are still tainted (as in, non-Bleached, get it? I really should stop this), the show is freaking addictive. I won’t tell you any details, mostly because I’m a lazy bastard, but partly because I don’t wish to rob you of the joy of discovering it.

Moving on, a little announcement. Not that anyone cares, but the site will be remodelled. I know it just started, but I’m just like that, and when I set my head on it, I really have to do it, or else it gets on my nerves so much i start to itch. Anyone who considers him/herself to know me at least a little just knows I have to scratch it. So, the hell with you. There is nothing you can do to stop me, mwahahhaha! Can you hear that? Yes, it’s the sound of Illustrator being open! By the way, on a sidenote (which may really be the only read-worthy content of this post, incidentally), the new Adobe Creative Suite kicks like, major (in italic and bold, whoaa) behind. I got the Design Premium Edition, and man, I shed metaphorical tears (of course, what did you think, that I was some lame-ass dude who cries himself over the new version of Photoshop? - wait, nevermind, actually) over the freaking piece of software. I mean, it’s about time a serious application makes use of the Mac’s Intel Power.

More things I wanna talk about… let’s see… ah, here’s something really worth the mention. If you still haven’t heard about it, then you seriously need to. The boys over here are seriously kicking ass with their Second UA project, which will make the University of Aveiro the first University in Portugal to have a presence inside the most current fad’s virtual world: yeah, I’m talking about Second Life, of course.

Ok, I guess that’s all, and may the weekend gods smile upon us all (except bakers, I f*cking want my bread fresh, goddamit).