December 2005 Entries

Meebo

 

Meebo is a web-based instant messenger application with similar functionality to Trillian. It appears to be another great implementation of AJAX. Do you find yourself integrating more AJAX type support into your online applications? As a whole are we becoming more concerned with the overall usability factor for our end user? Is the concern for usability becoming more important as it becomes easier to provide solutions to the masses or are the demands of our end users becoming more stringent? I'm interested in your thoughts?

Fun with Ruby

 

Some of you may know that I like to play around with other programming languages, one of those being Ruby. I came across a t-shirt the other day and thought it was pretty funny. I modified it just a tad so you can run it from the console. Here it is:


class Programmer
def initialize(language)
@language
= language
end
def happy?
@language
=~ /ruby/ ? true : false
end
def make_happy!
puts @language
= 'Ruby'
end
end
you
= Programmer.new(gets)
unless you.happy?
you.make_happy!
end

Casting in C#

 

Garrett Smith of ThoughtWorks discusses his thoughts on the two different ways of performing casting in C#. Garrett states that he prefers the C-style mechanism of casting as it "crashes early". Here's the distinction, when a cast is performed in C# using the C-style casting syntax such as the following:


SomeObject s = (SomeObject)hashTable[i];

An InvalidCastException will be thrown if the cast fails. So, with defensive programming techniques, we are encouraged to wrap our code in a try/catch block. Garrett then mentions that using the "as" operator to perform casting is problematic due to the fact that no exception is thrown. While this is true, when looking at the documentation for the "as" operator, it is noted that when the type conversion fails, null is returned. So in our particular case, we would want to write it as follows:

SomeObject s = hashTable[i] as SomeObject;
if
(s != null)
{
// continue on...
}
else
{
// decide what to do here.
}

Given this option, we now have the opportunity to control whether or not to create and throw an expensive exception or possibly dispatch control back to our application another way without continuing on with a null object reference. We could even further augment our check by using the “is” keyword to check to see if a type conversion will work before making the attempt to cast.

Rat Race

 

Google just release an API to allow you to create modules that can be plugged into your personalized Google page. These modules can then be published to their module directory for others to use. Live.com at this time does support a feature this rich, however I'm sure it's just a matter of time. Is this just another sign of web 2.0 knocking on our doorsteps?

Test Driven Development on Google Groups

 

I have recently created a Google group for test driven development. If you want to discuss test driven development, regardless of the technology, feel free to stop by and join in!

http://groups.google.com/group/test-driven-development