Saturday, 26 September 2009

What do we need to use IronRuby?

This post is an answer to Jimmy Schementi's Twitter question:
jschementi: Time to start building real #ironruby and #ironpython websites: what content (other than the obvious get/learn/etc) would you like to see?
I'm not going to speak about creating new applications, I'm going to describe a switch of existing ASP.NET application written in C# to IronRuby. Let's have a real-world example. I'm working on a rather huge ASP.NET application dealing with user photos. We use NAnt to build our application, NUnit to test it. Application is layered, we have separate layers for presentation, business logic, data access, etc. We're using ASP.NET 3.5 and have started switching new functionality to ASP.NET MVC 1.

The main question is: what can IronRuby give us? Yes, I'm a HUGE fan of Ruby and I just love it, but my personal usually don't play role in pragmatic reasoning whether to use some technology or not. So let's see what parts can be improved with IronRuby.

1. NAnt - definitely YES, I'm going to smash all barriers and promote usage of Rake. I use it in my home fun project, but fun is not production, fun is not money (at the moment). So what stops me from promoting Rake? Small numbers after it's name: 0.9. No one in company where I work will use something still in Beta status. So that's the first requirement.

2. Testing. According to Patrick Gannon post about Cucumber IronRuby testing could be a real fun. Though, we already use NUnit for testing. Why should we switch to anything else? Or should we use IronRuby with NUnit? To see real advantages we should see comparison of C#/NUnit vs IronRuby/Cucumber. Will it be faster? More readable? Will it increase unit test coverage? That's the second requirement

3. We use MVP for existing ASP.NET 3.5 parts and... guess what we use for ASP.NET MVC? ;) Will we be able to switch our presentation layer to IronRuby? What benefits will it give us? And, moreover, what problems may is cause? My main concern is performance. Ruby itself is a slow language, at least this is true for Ruby 1.8.6, the exact Ruby version IronRuby replicates in .NET. Will it be faster than original Ruby 1.8.6? And what about Ruby 1.9? 2.0? What about our beloved C#? Will IronRuby give us something new and useful in MVC controllers? Models? Views? There are two more requirements: performance benchmarks (vs C# and Ruby) and comparison of business logic layer (for example) in IronRuby vs C# implementation.

Let's sum up the requirements:
1. Final version of IronRuby, ready for production
2. Comparison of C#/NUnit vs IronRuby/Cucumber
3. Performance benchmarks vs C# and Ruby 1.8/1.9
4. Comparison of business layer implementation in IronRuby and C#

That's what will be asked from my pragmatic colleagues in the first place. And what about my own opinion? First of all, I repeat, I'll force them switch to Rake :) That's for sure and I can see real benefits. Testing: I'm satisfied with NUnit and not sure what IronRuby testing will give us. Business logic and presentation layer: I don't think I want to use IronRuby everywhere. Perhaps, it will only be used in presentation layer, for example, or any other area that will benefit from it and will not suffer from performance decrease. But to see where it can be used or can not - I need to see benchmarks and real benefits.


kick it on DotNetKicks.com

No comments: