Are you joking “It compiles, ship it!”? You might actually be doing just that…

A while back, I talked with someone about using the Singleton Design Pattern vs. using an IoC container and registering your class as singleton.


IoC containers are regularly bootstrapped wrongly, resulting in your product not working as it should. And you don’t discover that until you startup the product. I’d rather use the Singleton Pattern. That way, the compiler will protect against errors.

Continue reading

Painting of a friend during an archery workshop

In January of this year, I invited a couple of friends for an archery workshop and dinner.
The goal was to hit the balloons taped to the target and at some point I exclaimed I’d paint a picture of the first person to hit a balloon.

I try to make good on my promises πŸ™‚ though I had to ask her for a photo of said painting, because although I swear I took a photo for my own private collection before I gave the painting to her, I can’t find it anywhere.. whoops..


Ahh, placed it in a wrong folder somewhere, here it is:


A composite validator pattern

Have you ever encountered something like this?
(Note: #r denotes a collapsed region of code)

public class MyBulkyClassThatDoesALot
    #r Private fields
    #r Constructor
    #r Another constructor
    #r Public properties
    #r Public methods
    #r Private methods

    #region Validation

    // meanwhile, somewhere on line 20485
    public ValidationResult Validate()
        ValidationResult result;

        if (this.somesituation)

        // Somewhere on line 20585
        return result;

    private void CheckThatSomethingHolds(ValidationResult result)
        if (this.somecondition)
            result.AddError(new ValidationError("Condition X failed"));

    private void CheckThatSomethingElseHolds(ValidationResult result)
        if (this.somecondition)
            result.AddError(new ValidationError("Condition Y failed"));

    private void CheckSituationDependentCondition(result)
        if (this.somecondition)
            result.AddError(new ValidationError("Condition SituationDependent1 failed"));

    // Are you tired of scrolling yet? Good, because this is how whomever reads this code shall feel in real life ;)

    private void CheckSituationDependentOtherCondition(result) { ... snip }

    // A sigh of relief when you reach the last one
    private void CheckLastThing(ValidationResult result)
        if (this.somecondition)
            result.AddError(new ValidationError("Condition Z failed"));

    #endregion Validation

    // And then, of course, there is a lot of code after this. If you're unlucky, there wasn't even a #region around all the Validation methods and you have to hunt them down one by one because they are scattered through the code.

Don’t worry, you’re not the first one to end up with this. Often, it started as a single validation rule that was just implemented directly in the class to be validated. However, there are some things to look out for.

Continue reading


The difference between an implication and a bi-implication is this:

I am a crazy cat lady. I just don’t have all the cats yet XD

Unit testing 001

“Man, I just love unit tests, I’ve just been able to make a bunch of changes to the way something works, and then was able to confirm I hadn’t broken anything by running the test over it again…” —

The benefits of unit testing are well known, as are the many reasons that are offered when asked “Why don’t you do it?”. The arguments I hear over and over are:

  • “It takes too much time.”
  • “Our code isn’t suitable for unit testing.”

I’ve discussed unit testing with many people in the past years and at some point, I discovered one of the main reasons behind the arguments that were actually offered. We human beings find it much easier to say “It’s not possible”, “It’s too expensive”, “I don’t want to” or “I won’t start doing this until I’ve seen it work” (this one I encounter surprisingly often and makes me smile nowadays) than to admit:

  • “I don’t know how”

Continue reading

LEDWall proto 2

I just sent out an order to have my very first PCB design ever manufactured! πŸ˜€


When I asked for feedback, they said it looked very neat for a first design πŸ˜€
Now all I have to do is wait for it and then I can solder on the components and see if it works πŸ™‚

Edit: CRUD! Yep, forgot to model the resistors. Let’s see if I can modify the PCB after it arrives. If not, back to the drawing board.

The Grid Master

On holiday this year, same as last year, I downloaded a few puzzle games for my phone. One of them was Einstein Grid Master by Kerelize. (You can find it in the Android Play Store.)

The game consists of a 10 by 10 grid in which the user clicks on various cells to place the next digit, starting at 1. The goal of the game is to fill the entire grid with numbers 1 through 100. However, you can’t just place the digits anywhere, you have limited possibilities to place the next digit.


After playing for a while, I decided that instead of endlessly trying various possibilities, I’d write a little program to do this for me πŸ™‚


The program is a little bare bones and only does some basic checking to determine whether continuing the chosen path has a possibility of coming to a solution, but it was fun to do anyway. On to the next puzzle I’m too lazy to solve by hand πŸ˜‰