Saturday, March 24, 2007

ASP.NET vs. Ruby on Rails

If you're a contracter and you're being paid a flat fee to develop a simple website that basically only collects data and creates reports, what language and toolset do you use? You don't have to every do maintenance and you can't fix bugs. You want to get it done as quick as possible since you're being paid a flat fee. You have the freedom to choose whatever hardware and software you need. Obviously, your personal skill set is important in determining your answer but for me, it's a decision between ASP.NET and Ruby on Rails.

I believe in RoR. I think that it's a great way to build a website, especially one with requirements like these. My main issues involve its maturity, its tools and my familiarity with Ruby. Maturity isn't a problem in itself, but there are other problems that will go away with time, and I see this as an immaturity issue.

There's too much room for error in deployment because I have to TTY into the server and type things into a command line. I also feel like I need to know a lot more about Apache or FastCGI or Mongrel or whatever. I don't trust the RoR tools. There don't seem to be very good IDEs for working in Ruby, largely because Ruby is so dynamic that a new type of tool is required. The libraries are untrustworthy because they're not standard. I don't want to deploy (or even work with) a library with bugs, and I don't know where to find out which is the mature library.

I'm only considering ASP.NET a viable option because of SubSonic. Without that library, I'd spent way too much time writing and debugging data access code. The issues I have with ASP.NET are the inability to create unit tests without bucking the framework and unnecessary complexity of using controls instead of HTML. ASP.NET doesn't do MVC. It has views and no controller, which is quite untestable. Last I used it, NUnitASP was the best way to test it but it couldn't come close to testing an entire site with AJAX and everything else. I've become increasingly uncomfortable with using the ASP.NET controls when they're anything more than thin wrappers around HTML controls. (Except the Login controls in 2.0 which I love. Feel free to stop reading now.) As I rely on them more, I see more side effects and I find that I'm fighting with them or writing code that I feel is like a hack. A master-detail view should be easier and have fewer corner cases.

MonoRail is getting close to usable but it doesn't have a view engine I'm comfortable with. I fully acknowledge that it may be the best option, but I'm going to need to test it out first, and I haven't.

I'd go with ASP.NET. I think it may take slightly longer but it would be easier. The tipping point is RoR's toolset. With ASP.NET, I can use Visual Studio and set up pages using the designer.