In a recent post I expressed a few thoughts on using a DSL instead of an XML config file. I followed that up with a technical look at monkey patching CLR objects using IronRuby, which explores a tiny bit of interop. These posts were precursors to this post in which I apply these ideas to an implementation that allows me to define ASP.NET MVC Routes using IronRuby. Also included in this download is an incomplete implementation of an IronRuby view engine. I haven't yet implemented layouts. IronRubyMvcDemo.zip Download (4.93 MB) This implementation works with the latest CodePlex...
In a recent post, I compared the expressiveness of the Ruby style of writing code to the current C# style of writing code. I then went on and demonstrated one approach to achieving something close to Ruby’s expressiveness using Extension Methods in C# 3.0. The discussion focused on how well each code sample expresses the intent of the author. Let’s look at the comparison: Ruby: 20.minutes.ago C#: DateTime.Now.Subtract(TimeSpan.FromMinutes(20)); C# 3.0 using Extension Methods: 20.Minutes().Ago(); It seems obvious to me that the C# 3.0 example is more expressive than the classic C# approach, but not everyone agrees. Several people...
UPDATE: Looks like Ian Cooper had posted pretty much the same code in the comments to Scott’s blog post. I hadn’t noticed it. He didn’t have a chance to compile it, so consider this post a validation of your example Ian! :) Scott Hanselman recently wrote a post about how Ruby has tits or is the tits or something like that. I agree with much of it. Ruby is in many respects a nice language to use if you think in Ruby. One of the comparisons of the syntactic sugar Scott showed was this: Java: new Date(new Date().getTime()...
Joel Spolsky follows up on his earlier remarks about scaling out a Ruby on Rails site with this post on Ruby performance. I’m afraid it is a thoroughly unconvincing and surprising argument. He states... I understand the philosophy that developer cycles are more important than cpu cycles, but frankly that’s just a bumper-sticker slogan and not fair to the people who are complaining about performance. A bumper-sticker slogan? That’s a surprising statement considering that FogBugz is not written entirely in C. Is it because Wasabi compiled to PHP or VBScript is saving CPU cycles? Hardly. As one might...