Wednesday, May 02, 2007

DLR is here! Ruby soon to follow!

IronPython (2.0 Alpha) is now available with the Dynamic Language Runtime (DLR).

Microsoft also announced support for JScript on the DLR. They say releases of Ruby and VB will soon follow. (source: Jim Hugunin's Thinking Dynamic: A Dynamic Language Runtime)

This is great news to me.

Wednesday, April 25, 2007

Microsoft to support dynamic languages?

ZDNet published news that Microsoft will publish a "Dynammic Language Runtime" (DLR) to provide support for dynamic languages like Ruby to run on the .Net CLR.  This is great news to me.  I've tried many dynamic languages for .Net, but haven't found anything I could use in production.  IronPython is the best I've found.  But you can't fully integrate it into existing C# projects.  IronPython can use C# classes, but C# can't use IronPython classes.  I cant wait until the day I can run Ruby on .Net, with full integration to non-dynamic language projects.

Wednesday, April 18, 2007

RSpec

I been using RSpec for about 1 week now. I must say I really love it. Anyone who has worked with me knows I'm a test-first style developer. Now I switched to a spec-first developer!

RSpec is a ruby library for Behavior Driven Development (BDD). It accomplishes the same purpose as Unit Testing, automated tests for development. The big difference is BDD changes the way you think about tests.

With BDD, you begin by defining a "context" which is a situation or state of the system under test. For example, for a Stack object one context would be an "empty stack".

Next, you define the "specifications" for the "context". BDD uses language such as "should be", "should not" to describe the specification. In the "empty stack" context, the specification might include "should be empty", and "pop should throw exception". Within the specification we add the test code to check that the specification is followed. Here is the ruby code for this example:

context "A new stack" do

setup do
@stack = Stack.new
end

specify "should be empty" do
@stack.should be_empty
end

specify "pop must throw exception" do
lambda { @stack.pop }.should raise_error
end
end


Notice how easy it is to read the code above. This is what I like about RSpec verses xUnit. The contexts and specifications provide guidance about how to orginize your tests.

RSpec does not stop there. RSpec also includes RCov so you can easily see a report of test coverage. This is very handy to find holes in your specifications and tests. RSpec includes a mock object framework to help isolate the system under test. You can also use the mock objects to test the object interation of the system under test. RSpec does support Rails development.

Anyone interested in learning Behavior Driven Development or RSpec, I highly recommend working through the RSpec tutorial. The tutorial really provides a great exercise in BDD. I had read about BDD, but it wasn't until I completed the tutorial that I internalized it. (If you need Ruby, you can download it from ruby-lang.org, I use the Windows One-Click Install. Then type "gem install rspec" on the command-line to get rspec. Very quick and easy!)

Sunday, January 07, 2007

XBox 360

I joined the ranks of XBox 360 players this holiday season. My gamer profile link is NeverSleep360. I've also put my gamer card on the side bar. Game On!

Friday, January 05, 2007

I'm on Google EngEDU!

Jack Herrington in his presentation Code Generation With Ruby (Google Video), a comment references Dave Thomas's Blog post Rails and the Legacy World which talks about my post Let ActiveRecord support Enterprise Databases! The reference is part of the after presentation discussion at about 35 min in the video. One of the developers talks about the technique I used to modify ActiveRecord to support Sql Server, and references my blog post. Wow! I only thought a couple of my friends read this blog.

Mr. Herrington's presentation provides a good overview of Code Generation, different options, and notes about when it is appropriate or not. He then shows some implementations of Code Generation using Ruby and ERb. The discussion after the presentation is very interesting. They talk about different experiences with Code Generation and Active Record.

A couple of months ago I did some SQL code generation in Ruby. I should create a post about it soon.

Friday, December 22, 2006

Wii Browser

Nintendo released a demo of their browser for the Wii. It seems to work pretty well for checking the weather, email, google. I tried a few of the kids sites like NickJr, but it only played some of the flash content. The videos didn't work since they were windows media. Since I can now check Weather.com using the browser, I doubt I would use their Forcast Channel.

If you have a Wii, try WiiCade which has some good games optimized for the Wii. There are also some wii flash games at Albino Black Sheep Wii Games; but I havent tried them so I cant comment on the quality of the games at Albino. WiiCade had certainly done a good job making a Wii optimized page, and providing good games.


Enjoy!