The Singleton design pattern is seemingly one of the most simple patterns out there, yet on several channels (forums, discussion lists etc.) people seem to be asking what the best way to do it is. A quick search for singleton implementations yields some very useful results, and given the simplicity of the pattern the language…


Copy + Pasting in Unit Tests

Some people love designing. Others love writing the code. While it’s true that some like testing and breaking software, I haven’t met a lot of people who enjoy writing unit tests. There’s something about them – getting 100% code coverage even though you know you’ll never encounter some situations, the repetitiveness of the set-up or…


Hello Win7.c

This marks my first post from a Windows 7 machine. I am *highly* impressed so far. The full reinstallation of my machine, which included a fresh install of Windows 7 and all my applications (around 30) took less than 8 hours. The actual Windows installation took under 1 hour (I’d say in the 40 minute…


The DATAbase is part of the DATA layer, so it should be used for … DATA

I was talking to a friend the other day, and he’s learning some Silverlight (which, as a side note is *really* neat). One of the things he’s doing is building an HTML control, so I asked the obvious questions – why? Well as it turns out, he needs to get some HTML and display it…


UTF-8 strings in C#

I was doing a code review a few days ago on a web service library. There was a message which was supposed to be stored in UTF-8, since the service is internationalized. The code looked similarly to this: 1: string someRandomText; 2: UTF8Encoding encoder = new UTF8Encoding(); 3: byte[] bytes = Encoding.UTF8.GetBytes(someRandomText); 4: string utf8ReturnString…


Platforms vs. Frameworks

First of all, apologies for not having any activity lately. I pretty much blame the lack of Internet at home, a situation now remedied. Since I mentioned that my work is for an online platform, I had some people come ask me what the difference between a platform and a framework are. Based on my current…


First post … sort of

For those of you who know me, you probably have read my previous posts. For everyone else, feel free to browse through my Live Spaces page. I hope to have some time soon to post some fresh content here. -Cos