« December 2003 | January 2004 Archives | February 2004 »

New Year

| 0 Comments
A combination of events in the run up to my Christmas break meant that I have ended up spending almost 2 weeks without feeling the urge to write any code. I've just chilled out and relaxed, watched some DVDs, saw LOTR ROTK, played some SSX3 and ate and drank too much. At the weekend I started to get my head back into coding thoughts by restructuring a couple of libraries that make up The Server Framework. There is a need to use async file reading and writing using IOCP and this code will be similar enough to the existing network handling code…

2003, The year of the test

| 0 Comments
Looking back on my blog entries for 2003 it's reasonably obvious that the big thing for me in 2003 was testing. TDD seems to work well for me and my clients. It's not a silver bullet but it is a useful tool and I find that when you're operating in TDD mode that nice code just unrolls in a nice, stress-free manner. What's more, the code usually seems to turn out better than that produced without using TDD. The structure and design is more flexible.…

Use and misuse of C++ nested classes

| 2 Comments
I like nested classes in C++. They allow a nicely fine grained approach to naming. Where a class may need to be called CRegistryKeyIterator if declared at namespace level it can be called Iterator if nested inside the CRegistryKey class. The problem is I think I tend to overuse the feature...…

.Net 1.1 TcpClient strangeness

| 2 Comments
There seems to be a wierd bug with .Net 1.1 and sockets...…

Template shims

| 5 Comments
I needed to implement the same interface twice in one object today. It took me a while to remember how I do this kind of thing so I thought it was worth a blog posting so that a) I can find it at a later date, b) other people can tell me of better ways to do this, and, c) other people can use the technique if they want to...…

In C++ why isn't this a reference?

| 5 Comments
In C++ every object has a "this" pointer. You could think of it as being passed as an implicit argument to every non static member function that the object has. It can never be null so why isn't it a reference? The reason I started wondering about this is that when using wiring objects together, such as when using parameterise from above, I often find myself wanting to pass a reference to the current class to some related object. More often than not I actually want to pass a reference and not a pointer, because the relationship is not optional…

Bitten by the one definition rule

| 0 Comments
I've just wasted 20 minutes or so on a nasty bug. I'd added a bit of test code and suddenly some other tests were failing but the reason for the failure seemed to be that a class's vtable was getting screwed up and a virtual function was jumping off into hyperspace... After some time stepping through the code for a while I could see that a function that should have been incrementing a data member was in fact stomping over part of the vtable. It looked like the compiler was failing to allocate the correct size for the object, which…

Back from Meribel

| 0 Comments
Just got back from a week's skiing in and around Meribel. Great snow, great company, a good time was had by all. Just holiday snaps....…

Oh good, comment spam

| 2 Comments
Just removed my first spam comments... It's almost nice that the spammers think I'm worth spamming, but only almost... If this is anything like my email spam then I expect that this is just the start of a flood... Does anyone have any advice on how to prevent this kind of stuff when using MovableType as your blog software? I've added the spammer's IP addresses to the list of addresses that can't comment...…

HeadCam2

| 2 Comments | 1 TrackBack
My new head cam arrangement worked well in Meribel. As you can see from the picture below, the new camera is much smaller than my previous rig.…

Admitting that your baby's ugly

| 0 Comments
I have a couple of days to myself. We've just shipped some code to a client a couple of days ahead of schedule and we're waiting to recieve a purchase order from another client so I find myself without any client work to do. I've decided to try and refactor The Server Framework code that we're using a lot right now. Whilst working on the code that we've just shipped I realised that the new code I was writing was much easier to test than the socket server library that formed a major part of the project, so now that I have…

Hacking our way to the first test

| 2 Comments
So I have some time on my hands and I've decided that The Server Framework code could do with some tests but before I can do that I need to refactor because the code was written before I became test infected and, well, it's not as good as it could be...…

How useful it could have been if...

| 4 Comments
I'm writing tests for some code. I have a function that I'm testing that looks something like this: bool CAsyncSocket::Read(bool throwOnFailure = false); If C++ allowed us to overload a function call based on return type then we wouldn't need the horrible throwOnFailure wart and the compiler could pick the right version depending on if we try to use the return value or not... So a call like this: bool ok = pSocket->Read(); would return errors and a call like this: pSocket->Read(); would throw exceptions... I know why C++ doesn't support overloads on return type and I accept that the…

So, what do these tests look like then?

| 0 Comments
After breaking the socket server into more manageable chunks I started writing the tests. CAsyncSocketConnectionManager is pretty easy to test, it only has one public function; Connect(). So, what exactly do these tests look like?…

Ok, I'm curious

| 4 Comments
I get quite a bit of feedback about the socket server code but I don't really know what people are using it for. So, if you can, leave a comment or drop me a mail and tell me.…

Knocked a few things off the list...

| 0 Comments
The refactoring and testing of The Server Framework code has gone pretty well. It's not complete but at least we have some tests now and the code is broken down into slightly more cohesive lumps...…
« December 2003 | January 2004 Archives | February 2004 »

About this Archive

This page is an archive of entries from January 2004 listed from newest to oldest.

December 2003 is the previous archive.

February 2004 is the next archive.

I usually write about C++ development on Windows platforms, but I often ramble on about other less technical stuff...

Find recent content on the main index or look in the archives to find all content.

I have other blogs...

Subscribe to feed The Server Framework - high performance server development
Subscribe to feed Lock Explorer - deadlock detection and multi-threaded performance tools
Subscribe to feed l'Hexapod - embedded electronics and robotics
Subscribe to feed MegèveSki - skiing