Thursday, 19 February 2009

Nullable<bool>


I don't like Nullable<bool>. The cognitive dissonance is louder and more dissonant than a Sepultura guitar solo. [3'00]

A boolean is defined as: "Of or relating to a data type or variable in a programming language that can have one of two values, true or false."

Two. Deux. Zwei. Dos.

TWO!

Not three.

But that is what exactly Nullable<bool> is. True, false and null. Three states.

What does null mean? It's got to mean something. You're either pregnant or you're not. You can't have a third state. A light switch is either on or off.

If a light switch doesn't exist then it's potentially very dangerous. Almost as dangerous as having a nullable bool.

If it has three states, it isn't a bool.

Tuesday, 17 February 2009

The Pomodoro Technique aka Tomatoes!

You say tomayto, I say tomahto.

One of the things buzzing around the blogosphere and twittersphere recently is the Pomodoro Technique.

The idea is fairly straight forward. You create 25 minute segments in which you concentrate on a single task. Nothing gets in the way of what you're doing. If you think of something during a task, or you realise that the task will need further sub-tasks, you are permitted to take a note, but you must finish your 25 minutes focusing on the task in hand. If the task takes 15 minutes, you still stick with the task. You "over-learn" it.

From the link above here's what you need:
  1. Pencil
  2. Kitchen timer
  3. To Do Today Sheet – today’s date, my name and a list of my activities planned for today
  4. Activity Inventory Sheet – my name and a unordered list of my upcoming activities in the near future
  5. Records Sheet – my sampled process metrics to be used for my process improvement
I followed Uncle Bob and bought a kitchen timer that looks just like a tomato. The problem is that it's very noisy. The ticking was starting to get annoying, so I knocked up a very simple software timer.

This is what it looks like while it's running. Note that the form title also has the time on it. This is useful because you can see how much time is left in your task bar.



When it's finished it beeps once and looks like this:



You can press start at any time to reset the timer to 25 minutes.

You can download the application here. The source code is here. No unit tests as this is a quintessential 'trivial' application.

You will need .NET 2.0 or later installed for the application, and Visual Studio 2008 for the source.