Scott Hanselman

Why Would a .NET Programmer Learn Ruby on Rails?

September 26, 2006 Comment on this post [11] Posted in ASP.NET | Ruby
Sponsored By

Very well written and thoughtful article by Stephen Chu up at InfoQ.

To be fair, I still think .NET is great. It has offered me a place where I am consistently delivering great business value to my clients. However, I constantly remind myself that there are multiple ways and numerous technologies to solving a single problem, some better than others. By being loyal to one technology stack, I am bound to unconsciously make biased decisions, which will ultimately hinder my ability to deliver business value.

Here's some choice tidbits, emphasis mine:

There are a few hurdles I had to go through in learning Ruby. First, I had to go through the emotions of accepting the fact that it will take longer to find a new Ruby solution than to use an existing technology that I am comfortable in. This is by far the most painful experience. But, after a while, you will start cherishing the fact that you are starting to develop multiple ways to solving different problems, and that’s where the pleasure comes in. Secondly, reading about Ruby/Rails only gets me so far. Practically using what I have learned helps me to remember what I have learned. Remember, use it or lose what you have invested time to read about.

This article says, better than I could, why .NET folks should look at Rails. If you're resistant to change (or installing things) try Instant Rails. If you refuse to install anything, and still want to Try Ruby, then try it directly in your browser.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
September 27, 2006 0:21
I agree wholeheartedly that focusing solely on one technology limits the choices of what technologies you can apply to solving a problem (obvious). In fact, I think that is rather obvious statement in and of itself.

However, there are only so many hours in a day and I find being expert in .NET consumes all my time. By broadening my focus to include other unrelated technologies I would lose depth by necessity.

Jack of all trades -> expert in none.

Is there a balance to strike?
September 27, 2006 1:20
If you want some of the Rails' features with ASP.NET, you should also check out Rob's cool SubSonic project on CodePlex. The url to the project is: http://www.codeplex.com/Wiki/View.aspx?ProjectName=actionpack

He also has a good video of it in action here: http://www.wekeroad.com/actionpackintro.html

It provides an ActiveRecord pattern for .NET that works with all of the built-in .NET and ASP.NET features as well (GridView, Master Pages, Security). Best of both worlds.
Bob
September 27, 2006 5:51
A couple of years ago I did contract web database work. Almost everything I did was internal, and most things were not very visable (surveys, report databases, admin systems). When we did a new application, the beginning part was always very painful as we went through iterations of the database schema. Sometimes we would realize late that we needed to collect an additional peice of info, or the customer would come up with a new scenario after they entered some numbers.

Ruby on Rails is flat *awesome* for this type of prototyping. I'm not saying it is a prototype only language, or that you cant do real applications with it. Since the data access, form ui and some display bits are generated/reflected, you can do this type of prototyping very quickly and with very few changes in code. Once things stabalize you can then switch it to .net starting with a fully baked database.
September 27, 2006 11:35
hi there,

the link to INstantRails -- about:instantrails.rubyforge.org/
it should instead be http://instantrails.rubyforge.org/wiki/wiki.pl

BR,
~A
September 27, 2006 16:43
I think that there are a lot of benefits from learning a different programming language. Even if you're not aiming at a language change, the process of learning stimulates parts of your brain that you, as a programmer, will find good use for. I'm not referring to something like a C# guy learning VB.NET or even Java; I's say it's more like a C#/VB/Java guy learning Python, Ruby, Lisp....
C# is what pays my bills, but that's not the end of the story. I started using Ruby for my local machine scripts (file parsing/transformations, build assistance, quick tests, etc,) nothing business-critical, but the more I learn the "facets of Ruby", the more I find use for the new knowledge in C# itself (or even javascript..you know, the prototype.js thingy).
Learning and sharing the knowledge, that's my brain food.
September 27, 2006 18:06
I installed InstaRails about six weeks ago (after months and months of hearing about it). I was immediately impressed. I can also say that I love C# and the .NET framework.
I have been struggling with a very complex web app for almost two years (ugh). I found myself circumventing the Page Life Cycle in ASP.NET often. I began dreaming about "alternative" ways to build Web apps in .NET. At the same time, I was increasingly influence by Patterns. When I explored RoR I discovered that it was the same sort of thing that I had been thinking of. In the end this led me to the Castle Project and MonoRail. For those of you who don't know, MonoRail is essentially a port of Rails to the .NET framework.
I think cross-pollination is incredibly useful. It may sound funny but I learned a lot for using JavaScript and ActionScript.
September 27, 2006 21:20
I still feel that I have more power using C# and .NET than I do with Ruby and Rails. I find that installs and configuration for the .NET runtime, IIS, VS.NET and SQL Server are easier than Rails, Ruby, mySQL and Apache. I like the syntax, compile-time checks, and casing of C#. I think a lot of the ASP.NET web controls are crap, but I love the server control architecture (create your own control, use XML markup to style/configure it and then let it spit out the correct HTML/JScript/CSS). I'm not a huge fan of the postback model, but it works in most scenarios. I'd like more control over the forms and postback (similar to Rails, PHP, and Classic ASP), but with a bit of work and a few custom HTTP Handlers you can create your own MVC framework that suits your needs. All in all, I think the ASP.NET framework has a lot of power and flexibility, there's just a lot of crap included that I have no interest in. Thankfully, you can "roll your own" as you see fit, or use what's included to get up and running immediately.

Honestly, I don't see what the fuss is all about with Ruby? More than likely... 900% of the attraction is the ActiveRecord pattern included in the ActionPack. Have you ever slapped a profiler on your app and seen the number of SQL calls made during the rendering of a non-simplistic web page? We could argue this to death, but I think Rails developers are creating a number of non-scalable sites (sure they work good when 1 user is testing them on a development machine) and fooling themselves in the process.

Let's face it... most developers don't like writing data access code... but there's no such thing as a free lunch.

The emporer wears new clothes.

That said... there is a bunch I do like about Ruby (the language) and bits of Rails that have influenced how I write my ASP.NET, Classic ASP and PHP applications.

September 27, 2006 21:21
Jeez, do I sound like a rambling idiot...
September 28, 2006 7:10
Instead of trying out RoR what do you think about playing around with a Rails like framework for .Net ala a@http://www.castleproject.org/index.php/MonoRail@Monorail. Personally the biggest hurdle for me in understanding RoR is the Rails part! I find that too many developers push Ruby as the strength of the package when it's really the Rails aspect of it.

Just my humble opinion. Love your blog!
September 29, 2006 3:58
I think it's important to note that Rails == Ruby, but Ruby != Rails. Rails is just a framework built using the Ruby language. Giving Ruby and try for your unit testing/scripting/ everyday I-just-need-to-do-this-one-thing-this-one-time needs is a great idea.

Hopefully, Jon Lam and co will be able to accomplish the same feats that the IronPython team has and we'll be able to write DSLs using Ruby within our .NET application frameworks.
September 29, 2006 18:29
The whole article is based on "i'm a consultant". Honestly for those of us in the Enterprise we don't have time to screw around learning additional tools during business hours. There are so many things on the MS platform to keep up with as it is any free time is spent trying to keep up with the .Net platform.

RoR does one thing, builds a web application. If I have a team of developers it doesn't make sense to say "we are going to use RoR for web stuff" but .Net for winform apps, web services, threaded applications, etc. We are under deadlines and cost our company money to re-invent ourselves in a new platform. If developers want to learn things on their own time that's fine but at the end of the day the Enterprise needs to be able to move people from team to team to work on various projects and RoR only does one thing so the value add of even looking at it in the Enterprise is pointless compared to the value of having one platform that can do ANYTHING whereby you can move people around as projects need it.

The title should read: "If you are a consultant, you may want to explore Ruby on Rails to have more technolgies to land more business."

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.