RoR

March 11, 2008

Last night I decided to have a break from the code. So I decided to read up on RoR. Evan had been harping on about how glorious it is so I thought I would give it a shot. I had a look at this intro tute, decided to print it out and ended up staying up all night reading the entire thing. It seemed the more I read on, the more I came to realise the similarities of RoR to the CodeIgniter php framework that I have come to love. The first impressions I get of RoR is that it has a strong sence of an application development environment about it. The OOP, the automation, the testing, its all just too easy. A little too easy some might say. Anyway, being a developer based predominantly on php & javascript there were a few things that stood out to me which were:

  • The forced OOP
  • Ruby’s quick & simple syntax
    • Method dot notation & no requirement to tack on empty parentheses after a method call that has no parameters.
    • A method automatically returns the return value of the last line of code in the method.
    • The ! and ? method notations.
    • Shorthand setter method notation. eg: car.mileage = 5000 instead of car.mileage(5000)
    • No ++ or — operators 😦
    • Shortcut string declearations that use quotes. eg: %Q(Arnie said, "I'm back!")
    • Array decleration of just using brackets. eg: service_mileage = [5000, 15000, 3000]
    • Shorthand string array declearation. eg: %w ( red green blue black )
    • Hashes
    • Symbols (like a string literal but with basic functionality)
    • Blocks! (like prototype .each())
  • The automated 3 environments (development, testing, production)
  • MVC architecture
  • ActionPack including ActionRecord (which I love in codeIgniter)
  • ActionMailer (rail’s generic email handler)
  • Code generation
  • Testing & Debugging

I think my next little web app that I try will be in RoR 🙂

Advertisements

2 Responses to “RoR”

  1. Prainl Says:

    Bro, you seriously gotta suss out your spelling issues…

  2. evan Says:

    you’re the man. i’m working on a rewrite of lolbattle.com in RoR just for fun. the reason it reminds you of codeigniter is that most (i’m not entirely sure about CI) of those PHP MVC frameworks are rip-offs of rails. However the ones i’ve used (i’ve only used symfony tbh) lack the finesse of rails. Make sure you are using rails 2.0 tutorials, heaps of new shit has been added since when the vast majority of the online tutorials were written (around v1.6). Have you played with the db migrations and what not? db:migrate VERSION=n was the first thing i missed when moving to symfony.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: