Jump to content

Ruby on Rails


bascule

Recommended Posts

Ruby on Rails is awesome, even if revprez likes it, but it's okay, because I've been coding it professionally since before he knew it existed!

 

What is it? Well it's only the latest, great way to develop web applications. Rails is the name of a framework (a set of libraries) which was developed for the Ruby language, which is kind of like Python but Japanese. In many ways the syntax looks a lot like Perl.

 

Anyway, in 5 - 10 minutes you can develop your first Ruby on Rails application. Just follow this tutorial and it will help you get started:

 

http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html

Link to comment
Share on other sites

:)

 

So what would you say are some of the advantages of Ruby as a language, of Rails as a framework? and then what would you say some of the disadvantages are?

 

What did you use before these two and how much of a difference has it made to your development?

Link to comment
Share on other sites

So what would you say are some of the advantages of Ruby as a language

 

Ruby's creator's goal was to create a language which maximizes programmer expressivity, allowing you to write as little code as possible and avoid writing the same code over and over again (embodied in the mostly Rubyist acronym DRY - don't repeat yourself. They've even made it into a verb... DRY out code)

 

of Rails as a framework?

 

Rails motto tends to be "convention over configuration", i.e. if 99% of people do something the same way, then make things hard for the 1% in order to make it the default for the 99%.

 

and then what would you say some of the disadvantages are?

 

Well, there was a huge prescription fallacy-based argument I saw today:

 

http://gregluck.com/blog/archives/2006/07/report_from_osc.html

 

Bottom line: The runtime is slow compared to bytecode-based runtimes like Java and Python.

 

Ruby uses dynamic typing, which many argue makes it hard to use on large (i.e. enterprise) projects, where type errors are caught at compile time.

 

Rails' solution is to advocate test-driven development, where you write tests first then code second (meaning your tests will fail until you write code that passes them). That way your code at least does what you designed the test to test for.

 

The solution for catching type errors then becomes to catch them with tests, rather than when compiling.

 

What did you use before these two and how much of a difference has it made to your development?

 

I've used a number of different languages for web development. The first language I ever used was... C, back in 1995 when it was either that or Perl, and I really hated Perl. After that, I jumped on the PHP3 bandwagon circa 1999, and stuck with that until I discovered Rails. I soon discovered PHP's lack of a cohesive framework became a huge problem, and I ended up writing very similar database glue over and over for everything I wrote in PHP. Eventually PHP5 came out, and I started investigating some database abstraction libraries (technically Object Relational Mappers or ORM) such as Propel and EzPDO. I found these to be an XML-filled headache. Then I discovered Rails, where everything was automatic. Huzzah!

 

Bottom line: Agile practices (which are infused into Rails and the way you're expected to use it) lead to faster development with less code and substantially less debugging time (since the overwhelming majority of your debugging can be done by tests)

 

You can throw new people on a project and let them manipulate the code without worrying that they'll silently break something. If they do, then hopefully the tests will catch it!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.