top | item 217411

Microsoft ASP.net or Ruby on Rails?

18 points| cavabien | 18 years ago | reply

How do ASP.net and Ruby on Rails compare? I couldn't find a technical comparison online and found only "microsoft sucks" answers elsewhere. I would like to understand the technical differences. I'm considering them for a social network project.

51 comments

order
[+] ericb|18 years ago|reply
ASP.net would be my second-choice to ruby on rails. It's a close call. If Castle's ActiveRecord was better when I tried it, I would have probably never delved into rails ages ago. I'm glad I did though.

In favor of Rails:

-There are pre-existing FOSS social network apps in rails you can modify.

-You have infinite scalability where your only multiplier is hosting cost b/c there are no windows licenses, so no obstacles to moving into the cloud, virtualizing, setting up a friend

-With rails, you are mostly saved from SQL. Castle's activerecord might do this on .net, but was lousy when I tried it a while ago. Might be better now.

-It is easy to be coddled by ASP.NET and not understand the parts underneath, which works well until the abstraction leaks (viewstate, page layout, etc).

That said, asp.net is not a bad option, and would be my second choice over the java frameworks I've tried, or php. .NET has a nice IDE and better tooling than Rails.

[+] subwindow|18 years ago|reply
I don't understand why this post was downvoted. It seems rational and inoffensive. The main post asked for opinions and he gave his- what's wrong with that?
[+] DanielBMarkham|18 years ago|reply
Might want to look into NetTiers (www.NetTiers.com). I haven't coded in a few months, and I'm not a RoR expert, but when talking to my RoR friends it seems like NT does a lot of the same stuff.
[+] jhollingworth|18 years ago|reply
I am a big fan of both RoR & ASP.NET (Although I only get paid to do ASP.NET :( ) and i've found are both awsome at doing very different things.

If you want a basic data driven application which isn't going to have a significant load, then I would go with RoR. I have personally found that when ever you go beyond that use case, you will very quickly find the limitations of the framework (e.g. you can't start a sepeartate thread in an action). Yes there are workarounds to these problems, but they are all rather experiemental and a bit hacky.

For all the thats bad about microsoft, the fact that they are making ASP.NET for profit means they are designing it for large companies which have very complex problems to solve. This means that ASP.NET is designed to be highly scalable and efficent.

What I would say is avoid WebForms at all costs, it is a horrible framework designed for desktop app dev's (using WinForms) to quickly get to grips with web development. Unfortunatly to get WebForms to act like a WinForms app requires a lot of horrible things (i'm pretty sure that satan invented ViewState). Also, as xenoterracide mentioned it will run best on Windows Server meaning you will probably have to go down the microsoft route and spend crap loads of money.

A better option would be to look at Castle Project (http://www.castleproject.org/) they have basically developed a port of Rails for C#. It has all the core concepts of Rails, works brilliantly on MonoRail and uses NHibernate at the core of it's ORM and so can you use whatever DB you like.

I think in the end, you shouldn't be looking at the language and saying this ones got more hype I should use that one. I would say look at the actual problem you are trying to solve, what are the requirements? Do you need something out in a couple of days which just does adds a few records to the DB? go with RoR. Are you making a massive data mining app which is gonna be run by 50k people? Go with ASP.NET (or MonoRail)!

[+] grantc|18 years ago|reply
Skip Castle, it pulls along a lot of baggage with it and its not for beginners. ASP.NET MVC with LINQ + NHib is my pick as most productive .NET web stack right now. I think there's enough literature out there to get you started on MVC, NHib will increase your learning curve a bit, but it should be a good second stage.

You can build anything with anything. It's mainly about what personally works for you and what kinds of skills you want to end up with on the other side.

Good luck.

[+] jshen|18 years ago|reply
"e.g. you can't start a sepeartate thread in an action)"

This sort of issue is why jruby is so appealing.

[+] snprbob86|18 years ago|reply
I am a hardcore huge big time C# fan. That said, I hate ASP.net with a passion. Two key reasons:

1) It tries to simulate WinForms. It's just the wrong paradigm for the web.

2) As much as I love C#, I feel that strongly typed languages are less than ideal for web development. Web development is inherently a dynamic environment. Javascript is dynamic, HTML content is dynamic, etc. etc. It is just easier and faster to build dynamic applications and test with page reloads than a typical compile & run loop.

[+] tx|18 years ago|reply
You don't hate ASP.NET, you seem to hate WebForms and for very good reasons. You don't have to use WebForms though, there are other toolkits available. In fact, I built a neat desktop application using ASP.NET stack once - you can embed it into any .NET process to neatly handle HTTP requests.

One huge advantage of ASP.NET is that it is crazy fast. After a while it generates native-code assemblies and you're basically looking at C/C++ speed when handling requests.

You can get yourself one of those newer (and cheap) dual-CPU quad-core servers with 8GB of RAM and this machine will handle some serious load (enough for most applications). This will allow you not to mess with distributed stuff and keep your stuff in RAM in between requests. Such setup will be an equivalent of a farm of RoR machines with MUCH smaller load on DB layer.

Of course, it doesn't apply to high-traffic projects like Twitter/Facebook, etc.

[+] justindz|18 years ago|reply
I've always thought that ASP.NET was an attempt to get MFC programmers building web applications while avoiding re-training them on how to build web applications.
[+] goofygrin|18 years ago|reply
Three things:

1. Look at the MVC framework for ASP.NET 3.5 as it makes ASP.NET act more like Rails

2. If you're going to use ASP.NET, use 3.5 so you can use LINQ and all the new 3.5 features. It makes your life WAY easier.

3. There is no real scaffolding for ASP.NET like there is in RoR. Well there is a kind of like it thing that was put out (http://www.hanselman.com/blog/PuttingASPNETDynamicDataIntoCo...).

Now, here's my take... if you learn ASP.NET/C# you will have marketable skills in most non silicon valley markets that you can use as a consultant or employee as need be. There are significantly less corporate jobs that are RoR than there are C#/ASP.NET.

Also make sure you look at Python/Django (which is normally what is argued with RoR).

[+] jon_dahl|18 years ago|reply
Good point in the second to last paragraph. Do you want a corporate job? If so, consider .NET or Java. Do you want a freelance/startup/independent job? You may find the Ruby (or Python etc.) community more supportive. There are exceptions to each - there are .NET startups, and Ruby is making inroads at lots of big corporations - but your career will likely have a different flavor depending on what you choose.
[+] elad|18 years ago|reply
I find that Microsoft tools in general offer a compelling package when you start out - great IDE, good docs and purportedly good support (I never use customer support myself, so can't comment on that from a personal experience). The problems begin when you want to move a step further - explore the code or hack stuff.

Also, you're stuck with their platform for everything. The advantage in using an open package is that you can mix and match. If you're willing to do some research and work, you can find the tools that best match your specific requirements and hack together your dream application.

In the end it really depends on your temperament as a developer. If you prefer easy gains initially and can live with the limitations down the road, plus you don't really care how it all works under the hood and rather just have something that works OK in the end, then I guess MS should be your choice.

The reason that you find mainly "microsoft sucks" answers in hacker forums, is that hackers love the freedoms that being locked in to the MS platform takes away.

[+] ScottWhigham|18 years ago|reply
You're likely to find that this group is 90% against ASP.NET - at least, in the past, most .NET-related posts don't end well or contain too much positive info. Not to mention you're question seeks out a pretty specific person/group: those who have tried both in difficult situations.

There are other things to consider than just the language. I live in Dallas, Texas and Dallas has wonderful colleges but none of them are really tech-focused. As such, we tend to have no MSFT-trained developers coming out of the tech schools. So, what that means is that Dallas has a very good group of open source developers vs. a smaller group of .NET developers (at least that's been my experience in trying to hire). So, does your area have more of one type of developer? That might influence you as well. If your startup succeeds, you'll need more folks to help and it's easier to hire locally than for a startup to afford a relocation package.

[+] goofygrin|18 years ago|reply
Wow, I live in Dallas and the .NET community is very large here (have you attended any of the .NET user group meetings?)

Honestly I find the OSS community to be very weak here since most developers are corporate type and they know either Java or C# or VB.NET. Every OSS (Python) meeting I've ever been to has been populated by back room tinkerers and people that "haven't done it" (tm) so they aren't any help to me with my real world questions and problems.

Now if you expect any college to put out good developers you have the wrong expectations for what college does. They are not Devry (which you should never hire a developer from Devry). Colleges teach theory not practice (which has been beaten like a dead horse on the net).

[+] jawngee|18 years ago|reply
Been a .NET developer since Beta 1. Spent the last 2.5 years in open source land.

ASP.NET has some good ideas, but the paradigm is completely incorrect. As another poster stated, it attempts to mimic WinForms development on the web, which is a layer of complexity that simply needn't exist.

ASP.NET MVC is a step in the right direction, but requires a crapload of plumbing and, honestly, is too little too late.

RoR ... I've only used it doing research. ActiveRecord seems like a bloated ORM with a lot of unnecessary overhead. Ruby is a kick ass language though.

Django is cool if you can look past the unfortunate choice of terminology.

You couldn't pay me enough to work on ASP.NET site at this point, on the other hand Rails has a tax that you'll have to pay some time in the future.

My only recommendation is to go the open source route. A lot of your problems have already been solved, and some of those solutions are MIA on windows. I laugh at Jeff Atwood running PHP on IIS and being steamed that there isn't anything approaching mod_rewrite for IIS 7. Vendor lock-in must really suck.

[+] ratsbane|18 years ago|reply
I strongly second the thought here (and in a few other comments above) that .NET fails because it tries to make web programming work like desktop programming. It doesn't.
[+] subwindow|18 years ago|reply
I would go with Rails because there are several options out there to give you a good starting point for a social network.

Try out Insoshi (http://portal.insoshi.com/) and Lovd By Less (http://lovdbyless.com/). Work with each for about a week and see if you like the way the code works and their extensibility.

Also, I'd concentrate on only one factor, at this point- what platform gets you to launch the fastest? Unless you have significant ASP.net experience, Rails will probably get you there faster. Add in the massive amounts of Rails open source code that you can build off of, and I think the choice is clear.

Don't pay attention to people who say "Rails can't scale" but haven't actually built a large Rails app. I run a Rails app that handles >1,000,000 hits per day, and I've spent about 3 hours resolving the scaling issues that I've run into.

[+] xenoterracide|18 years ago|reply
Feel free to tell me if I'm wrong, but you have to run a windows server to run asp.net and that comes with a whole plethora of maintainance and security issues. There's also the cost factor, you know IIS, MS SQL, etc... If you want the whole M$ package. It gets expensive just to break into it, and even worse on maintainance, as you have to watch out for all those viruses and broken service packs. This is why people say Microsoft Sucks. So there is some technical merit to it.

I believe asp.net can be run on *nix via mono, and an apache mod. However, my experience with mono is that it sucks (I've never developped in it just use apps developped in it).

Other than advising against the M$ path on an administrative perspective, I can't really give you a fair comparison.

[+] ComputerGuru|18 years ago|reply
Sorry, but IIS is free (assuming you have Windows) and I'm coding .NET and MySQL as I write this. Oh, and I've never seen a server run by a proper IT admin get a virus - only people who use the server as a workstation get infected.
[+] tptacek|18 years ago|reply
In 2008, the security argument tilts strongly in favor of Microsoft on this one. 37signals hasn't paid millions of dollars to have 10 different security research firms review the code and write penetration test cases and fuzzers. Microsoft started on IIS back in 2003.

I wouldn't use security as a deciding factor (we're a Rails shop), but if I did, I'd be writing C# now.

[+] gaius|18 years ago|reply
Express Edition of MSSQL is free too (and actually a very good database).
[+] pragmatic|18 years ago|reply
I'm a an asp.net/C# programmer by day. I developed a RoR app for a client on the side. The problem was you couldn't keep the darn thing running. RoR was unstable as heck for me and was missing some features that were dead simple in asp.net. (At the time I couldn't find a good zip library, the one I found had documentation in Japanese).

If I were comparing asp.net to something I would consider django or just PHP. PHP has a heck of a deployment story. I run MANY wordpress blogs on the side and centos/mysql/apache/php is rock solid AND fast.

My 2 cents.

[+] jshen|18 years ago|reply
I've done 4 professional rails apps and many personal ones. I've never had a problem keeping them running. Did you spend any time trying to figure out why they were crashing?
[+] pcrawfor|18 years ago|reply
I moved from an msdn shop into a rails-based startup. I totally agree regarding the comments on winforms...I wrote an internal app with it and it is just not a great option.

Rails has been great so far and I have three production projects and a couple more on the way running under it. Rails is continually moving but is not perfect for all situations by any means.

I personally don't think I'd build an app using another language although I am interested in trying out some variations on rails like Merb (a more light weight web framework written in ruby) and also some of the other platform alternatives based on ruby such as jruby and ironruby (the .net implementation of ruby).

As another option I've heard it said that ironpython the .net implementation of python is a pretty good language option for .net web apps as well.

The thing that always held me back for web apps and MS is the server software...I am not a huge fan of paying licensing fees for server software when sooooo many great options are available open source.

[+] meddah|18 years ago|reply
Hi,

Ruby very nice language. But I think, Rails not flexy. I dont like Rails. ASP.NET nice, easy and extendable architect but windows sucks and very expensive server cost for new start-up.

Maybe, you must use Linux + PHP + MySQL ;-)

[+] dbrush|18 years ago|reply
Down-modded for English that isn't impeccable?
[+] drawkbox|18 years ago|reply
It doesn't matter, if you are a competent programmer you can use .NET, RoR, Python, Java, PHP or anything to make it work efficiently. Tools do not make the system better, the people working on it do. There is 'magic' in both the systems that you mention but you should be aware of the underlying 'magic' and architect a solution that works best. Rarely today are programmers limited by platform. The only concern with .NET is platform lock-in but if you go with mono there is no concern.

You will find languages and platforms are like religions or brands, everyone has their favorite because it worked for them but it doesn't make them the best. Just the best for them and their conditions/constraints/knowledge.

[+] senthil_rajasek|18 years ago|reply
Other than the cost and the admin factors building, deploying and debugging/troubleshooting web applications in ASP.NET environment simply rocks! Not to mention the IIS sweetness and scalability models.

I have a facebook application (http://www.facebook.com/apps/application.php?id=5595659604) that I built using the LAMP stack, something quick and dirty . I like the LAMP stack and have nothing against RoR but be prepared to spend a lot of engineering resources in scaling these.

Case in point try debugging a web server crash in your favorite RoR web server vs ASP.NET/IIS environment.

[+] pragmatic|18 years ago|reply
Don't forget Linq. Linq to XML is awesome. No more xpath. One of my colleagues left the RoR camp after he couldn't get xml parsing to work.
[+] tptacek|18 years ago|reply
Details? In my experience, XML parsing is one of the easiest things to do in Ruby.
[+] danw|18 years ago|reply
The tools available for .Net development are better, in my opinion. Visual Studio and IE Developer Toolbar (not the IE8 version) make debugging javascript lovely whilst the Resharper extension enhances VS' features nicely. Also give VisualSVN a try for Subversion integration.