PDA

View Full Version : Ruby on Rails


The Rick
03-06-2006, 03:11 PM
Any of you hardcore web developers have experience with Ruby on Rails (www.rubyonrails.org)?

I've been looking into it a lot lately and have watched the screencasts on the site. I'm pretty impressed. Today, I followed a tutorial and created a basic application. I'm still quite impressed.

Simplex3
03-06-2006, 05:36 PM
Ruby is a hell of a language in theory. I don't know how that translates into practice, however.

KC Jones
03-07-2006, 06:59 AM
Ruby is a hell of a language in theory. I don't know how that translates into practice, however.

For the few mature applications it translates really well (such as rails which is killer for simple crud web apps). However, it has a long ways to go before it would ever be ready for enterprise development. Plenty of issues with threading, etc. There is always the dynamic vs. static typing argument and that in turn points one to the issue of performance - dynamic typing will always be much slower and a little less safe, but you get greater flexibility and development speed.

skye22f
03-19-2006, 10:04 PM
For the few mature applications it translates really well (such as rails which is killer for simple crud web apps). However, it has a long ways to go before it would ever be ready for enterprise development. Plenty of issues with threading, etc. There is always the dynamic vs. static typing argument and that in turn points one to the issue of performance - dynamic typing will always be much slower and a little less safe, but you get greater flexibility and development speed.

Rails isn't really aimed at the enterprise though, that's the thing. If you have an app that is gonna use a legacy db with 150 tables that's sharing the db with a bunch of other apps, yeah, rails isn't for that.

I think it's very good for a whole lot more than simple crud web apps though, there's so many things about it that save you time, save you from writing lines of code and save you headaches. I think all the hype with the videos where they generate scaffolds and say ooh look at this- I think that does rails a huge disservice.

As far as speed, I haven't encountered any problems. It's caching system renders things faster than ASP.net or Java's caching according to my tests, and if you make good use of it you'll do pretty well.

One of my favorites thing also has to be the way testing is baked right in. Makes test driven development a piece of cake (and that's something that I think is very important especially when you are working with a dynamic language.) DB migrations are sweet as well... overall everything fits together really sensibly. It's great and it's just continuing to get better (1.1 is bringing even more good stuff, rjs templates? I like...)

KC Jones
03-20-2006, 08:09 AM
Rails isn't really aimed at the enterprise though, that's the thing. If you have an app that is gonna use a legacy db with 150 tables that's sharing the db with a bunch of other apps, yeah, rails isn't for that.

I was talking about Ruby. It's a great little language and Rails is an example of a very mature app/framework for it. Ruby itself isn't ready for the enterprise though.

I think it's very good for a whole lot more than simple crud web apps though, there's so many things about it that save you time, save you from writing lines of code and save you headaches. I think all the hype with the videos where they generate scaffolds and say ooh look at this- I think that does rails a huge disservice.

Interesting. They should stay focused though. If they get too far off serving their primary goal and try to become the uber framework that does everything, they will become too much like the uber bloated Java APIs. I'm a strong devotee of the KISS principle and the more flexibilty and configuration you try to add to something the more it becomes an unusable POS. At least with Rails they stay devoted to he idea of always having defaults so you can drop it out of the box and use it without having to turn dozens of knobs.

As far as speed, I haven't encountered any problems. It's caching system renders things faster than ASP.net or Java's caching according to my tests, and if you make good use of it you'll do pretty well.

As in a database/persistence cache? Or are you talking more about caching web pages? Either way I'd be very surprised if it can outperform a modern JVM. I do a lot of big enterprise backend J2EE stuff and have had amazing success using Tangasol's coherence for a distributed cache. The messaging framework I work on now handles 12 million external transactions a day - each of those are composite calls some of which translate into dozens of internal transactions. We've been able to scale out really well and now we're looking into some products for automating on demand resource allocation across the grid. We should be able to improve our load balancing dramatically and reduce the number of servers that are only getting modest CPU cycles most of the time.

One of my favorites thing also has to be the way testing is baked right in. Makes test driven development a piece of cake (and that's something that I think is very important especially when you are working with a dynamic language.) DB migrations are sweet as well... overall everything fits together really sensibly. It's great and it's just continuing to get better (1.1 is bringing even more good stuff, rjs templates? I like...)

Once you throw out static typing, Test Driven Development almost becomes a necessity. Too much risk otherwise.

skye22f
03-20-2006, 03:14 PM
Interesting. They should stay focused though. If they get too far off serving their primary goal and try to become the uber framework that does everything, they will become too much like the uber bloated Java APIs.

I think not turning into that is a huge priority. It's kinda the anti-Java in a way, and the commit team can be stingy about what goes in. Fine by me.

Or are you talking more about caching web pages?

Yeah, web page caching. I don't know how to go any faster, honestly, because if you have page caching in place it bypasses rails completely and it gets served up as static HTML. Lighttpd does it, not rails. Hard to beat that.

Either way, the point isn't that ROR is faster than Java stuff (for most things, it's not.) The point is that it's fast enough for most things.

I do a lot of big enterprise backend J2EE stuff and have had amazing success using Tangasol's coherence for a distributed cache. The messaging framework I work on now handles 12 million external transactions a day - each of those are composite calls some of which translate into dozens of internal transactions.

That's great, but I'm not sure how relevant that is- if you were on my team and you suggested doing a project like that in RoR, you wouldn't be on my team much longer. That's not really what rails is for. Although it can scale pretty well (at it's heart it's basically a LAMP stack, just like the one running all kinds of stuff out there. There is at least one RoR site out there serving a few million of dynamic requests a day [www.eins.de], but I would be wary of that for now.)

Once you throw out static typing, Test Driven Development almost becomes a necessity. Too much risk otherwise.

I like TDD anyways (among other agile practices), I do TDD even for statically typed languages (mostly C# stuff unfortunately, but nUnit is ok.) I feel naked without a solid suite of tests and writing them before you write the code has a lot of advantages.