# Wednesday, August 19, 2009

I’m really liking Ruby on Rails for numerous reasons, and chief among these reasons is the ability to make a change to Ruby code and then refresh the browser to see the changes.  In other words I really like to avoid paying taxes, and in this case the compilation tax we all pay when using a static language.

For a couple of years now, since I started using MonoRail back in 2007 I’ve always felt that productivity could be improved by writing not only views in a dynamic language, but the controllers too (maybe the entire app). There’s just something refreshing about making a change in server side code and immediately see the changes without waiting 30 seconds for a complete recompile of the entire application.

Yesterday I was heavily doing some TDD on a very low level componenent in our application and wasted about 10 minutes waiting for Visual Studio to recompile the project I was working on… and then every other project that depends on that one. It takes a lot of focus to keep the TDD rhythm going when you’re forced to wait 1 minute between runs.  I just have one word for this, painful.

I can only imagine the benefits of doing TDD with a dynamic language since you have a whole lot more compile and test cycles with TDD than traditional programming techniques. The emergence of TDD over the past few years along with general acceptance of the practice will only further push teams towards dynamic languages. Sure you lose static type safety, but that’s why we have lots of good unit tests; and at the controller level that’s not a bad thing because you’re often dealing with key value pairs (think web form post or json DTOs) and a dynamic language is just a much more natural fit.

I’m not completely sold that unit testing at the controller level always makes sense, it often involves too many collaborators and whole lot of mocking. With automocking this isn’t so bad, but sometimes you have complex Ajax interactions in the middle and testing at a higher level via a web test sometimes makes more sense.

I’m hoping Microsoft seriously starts supporting dynamic languages (the DLR) and makes it a first class citizen rather than pushing it to the side in favor of more C# language sugar. I was very disappointed to see that Visual Studio 2010 has no support what so ever for Python or Ruby (unless I completely missed it somehow). Actually, I was shocked! The future belongs to dynamic languages and Microsoft is almost completely ignoring them. If they would support them officially along with ASP.NET MVC, the .NET world would be a whole lot better off.  Without dynamic languages the ASP.NET MVC 2 gets a B in my grade book (version 1 gets a C). Maybe its time to switch platforms?

.NET | IronPython | MonoRail | RoR
Wednesday, August 19, 2009 3:47:59 PM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  | 
# Tuesday, August 11, 2009

I’ve been futzing around with RoR for the past week on my train rides to and from work and finally feel like I’m making some progress beyond Hello World type of stuff.  Not much progress, yet I think tonight I’ve finally hit the tipping point.

I’ve been waiting for this all week.  Its not much, but I can create and edit not only a simple model, but a model and its component on a single form, think client –> address.  More importantly I’m doing it correctly, using the new RoR 2.3 accepts_nested_attributes_for support.  I looked at the pre 2.3 code to do the same thing, ouch!  Basically 2 lines of code and I still restful controller!

its probably about time I move towards some domain logic and unit testing.  I’m still fuzzy if all RoR model tests touch the database or not, I’m used to mocking my repositories in C#, and as you may know there are no repositories with AR.

RoR
Tuesday, August 11, 2009 1:22:28 AM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  |