January 2006
-
:
Programming by contract in C++
There’s the first part of what I expect to be a very nice article about programming by contract in C++ over at The C++ Source: The Nuclear Reactor and the Deep Space Probe. Updated 3rd Jan 2006 - the article now appears to be called … -
:
C++ Tips: 1 - Avoid unnecessary optionality
One of my main aims when writing code in C++ is to have the code clearly communicate its purpose. I find it useful to be able to look at a single line in isolation and have a pretty good idea of what its effects are on the code that it … -
:
C++ Tips: 2 - Avoid designing undefined behaviour
When designing code it’s often easy to include undefined behaviour. The need for code that exhibits this kind of behaviour is, however, generally pretty rare and there are often ways around allowing undefined behaviour. In general … -
:
C++ Tips: 3 - Strive to be const correct
Another extremely powerful tool that you can use to ensure that your C++ code communicates as clearly as possible is const. By correctly using const all the time when designing your abstractions you can divide an object’s interface … -
:
LEGO Mindstorms NXT
LEGO has announced a new version of their Mindstorms autonomous robot building system. I did a fair amount of playing around with the original Mindstorms kit way back when and created a system that allowed you to control your robots over a … -
:
iTech Bluetooth Virtual Keyboard
VirtualKeyboard.jpg I recently purchased an iTech Bluetooth Virtual Keyboard for use with Michelle’s PDA. It’s basically a little box that’s about the size of two packets of chewing gum with a red window in the top. It … -
:
C++ Tips: 4 - Learn to work in terms of abstractions, no matter how small
In the fight to make C++ code easier to reason about and understand, never underestimate the value of a name. Giving something a decent name is the first step in thinking about the concept at a slightly more abstract level. Abstraction is … -
:
Grumpy old men
Am I a curmudgeon of technology? You betcha - Ted Neward over at “The Blog Ride” explains why he’s cynical about new technology and suggests that we’d do well to have a little more cynicism. I agree with him, I tend … -
:
Implicit Interfaces
ImplicitInterfaceImplementation - from Martin Fowler is an interesting piece where Martin suggests that it would be useful to be able to provide alternative implementations of a class’s implicit interface. That is, given a class that … -
:
Something all C++ programmers should know when using managed C++
Beware! The rules for when a destructor is called for a managed C++ class in Visual C++ are different than for “normal” C++ class. Jochen Kalmbach recently posed a simple question about a managed C++ class; “Will the … -
:
Now I'm confused (C++/CLI destructors)
So here I am, writing a piece about how the C++/CLI destructor and finalizer stuff could have been a bit neater and I put together some sample code to demonstrate my point and it doesn’t do what the docs I mentioned yesterday suggest … -
:
Detecting the Excel Function Wizard
I’m currently working on some C++ Excel addins for an investment bank. I originally wrote the addins for them back in 2001 and they’ve evolved slowly ever since. Right now we’re adding some new functionality and, whilst … -
:
Beware the momentum of prototype code
A while back Chris Baus wrote a little rant about prototypes. I started to write a piece that defended prototypes when correctly used and ran out of steam; or, more to the point, couldn’t really say very much except they’re OK … -
:
Excel addins sharing data
Or, marvelling at my own, past, cleverness. I’ve been doing a lot of work on these Excel addins for my current client and, as I get back into the whole C++ XLL stuff, I start to realise just how cool my child of 2001 really is. The … -
:
Online autism 'test'
I scored a 28, which is “above average”, so considerably nearer to Asperger’s than it is considered to be “normal”. Which, to be honest, seems about right to me. If nothing else, it might make you think… … -
:
Shaping the future of the XLL interface in Excel 12
If you’re into writing C/C++ XLL addins for Excel and you’d like to help make sure that the new features in the new XLL interface provide all the functionality that you’d like, then it might be an idea for you to get in … -
:
So that's what it's called
Jeremy D. Miller points out that my ‘second’ style of coding (see here) is called writing a “spike” in XP terms. -
:
A collection of links
Once again I’ve been too busy to comment on the following blog postings in a timely manner so here’s a collection of stuff that’s been sitting in my “good stuff” list for a while now. Josh Carter over at … -
:
Purecall
I’ve been plugging away at my multi-process Win32 debugger code this week and one of my test harnesses had started to suffer from intermittent “R6025 - pure virtual function call” errors. These tend to crop up if you call … -
:
First tracks
Last week I managed to get my GPS code to download the GPS “track” from my device and create an html file that uses the Google Maps API to display it as an overlay. I spent some time trying to get the map to display correctly … -
:
When your mocks are executable
The size of the “units” that I test with my unit tests varies quite considerably. Usually I tend to work at the single class level; the test will provide mocks for the services that the class requires and the tests will ensure … -
:
The best toys always come with an SDK, 2
I finally got around to upgrading my mobile phone from an aging Sony Ericsson T68i to a more current (though still hardly bleeding edge) Motorola Razr V3. I’m not interested in the downloadable java games but the fact that you can get … -
:
Charles Petzold on why he loves books
Charles Petzold confesses his love for books. I must admit this bit really hit home for me: “I love how my books remind me of passages in my life. I love the shelves of authors I’ve been obsessed with, and the books that knocked … -
:
Always Produce
Paul Graham writes about “How to do what you love”… It’s quite a good piece but the best bit is hidden down near the end. He suggests that a good way to “stay honest with yourself” about dreams to do … -
:
Look back and shudder
I’m currently investigating a memory leak in a complicated piece of multi-threaded code. Unfortunately the code doesn’t have any unit tests and the leak only shows up reliably in the release build. Worse, I wrote the code and … -
:
Leak plugged
Well, the leak in my legacy code wasn’t too hard to find. There was one potential leak and one screamingly obvious leak. I’ll post the fixed code tomorrow. -
:
More on the socket server leaks
It seems that the leak that I found isn’t likely to be the one that my new user of the code is having problems with. They’ve built the code with Visual Studio 2005, made a few (correct) changes to the code to get it to build …