Geek Speak
Software development, technology, gadgets, etc...
XML RSS feed for this category.
[Valid RSS]


Managed XLL Excel Addins Posted by Len at 25 Jun 2008 08:55 AM
Back in December and January I was working on the initial phases of a system to allow the development of custom Excel worksheet functions in managed code using the Excel XLL 'C' interface (Excel4v). Phase 1 finished with us having...


Interesting blog Posted by Len at 6 May 2008 12:30 PM
I found JP's blog whilst googling for some information on RVA forwarders in PE files. There's lots of good stuff there about reasonably low level Windows development, debugging, testing and API hooking. Recommended if you like the kind of stuff...


WOW64 Win32 DebugAPI CLR application startup change Posted by Len at 1 May 2008 04:43 PM
Back in October 2007 I sumarised my findings from getting my Win32 DebugAPI based debug engine working on x64. One of the strange things that I found at the time was this: When running a CLR app under the Win32...


Spam gone... Posted by Len at 24 Apr 2008 08:52 AM
The endless torrent of bounce messages began again yesterday evening. Once again it was arount one email every 2 minutes or so. I turned on my laptop this morning expecting a few thousand emails to download and only a third...


What would I do?? Posted by Len at 15 Apr 2008 10:24 PM
There's an entry over on the Dr. Dobbs blog about testing and how you make sure that your tests are testing the right thing; effectively, who tests the test. There's a question at the end "What do you do?" and...


PQR - A Simple Design Pattern for Multicore Enterprise Applications Posted by Len at 14 Apr 2008 05:44 PM
There's an interesting article over on the Dr. Dobbs Code Talk blog; PQR - A Simple Design Pattern for Multicore Enterprise Applications. It documents a design that I'm pretty familiar with and one which has worked pretty well for me...


It seems I'm not the only one... Posted by Len at 7 Apr 2008 07:05 PM
It seems I'm not the only one to make mistakes with GetTickCount() based timer code, see: System.Threading.Timer fires immediately when specifying a large value for due time....


And then there were three... Posted by Len at 22 Mar 2008 08:53 AM
This morning a new Ready NAS NV+ unit arrived, so now I have three. I didn't have a sudden change of heart about buying a development box, the power supply in my office NAS died on Thursday afternoon and buying...


ReadyNAS development... Posted by Len at 18 Mar 2008 09:22 AM
As I mentioned a while back I'm using a pair of ReadyNAS NV+ RAID systems as my on-site data store and off-site backup. These are both working well and I'm pleased with the solution. After a few hickups and delays...


Bug in timer queue code Posted by Len at 18 Mar 2008 09:15 AM
Whilst I've been away I've had a bug report for the TDD timer queue code that's available here. The report is completely correct and could result in a timer being scheduled out of sequence if it's scheduled around the point...


.Net Abstract base classes vs. interfaces Posted by Len at 21 Feb 2008 01:20 PM
An interesting piece here from Phil Haack about why they decided to use an abstract base class rather than an interface. Versioning is always a complicated thing for library designers. I know that I'm lucky in that I don't have...


When are asynchronous file writes not asynchronous... Posted by Len at 20 Feb 2008 09:51 AM
For some time I've had a class which implements asynchronous file writing. It's the basis for a logging class that some of my clients use. The class builds on several of the classes used in my server framework and uses...


Major Vista Overlapped I/O change Posted by Len at 18 Feb 2008 08:17 AM
I'm still reading the Richter book, highly recommended even if you've read one of the earlier versions. In fact it's possibly MORE highly recommended IF you've read one of the earlier versions... It seems that lots of things have changed...


Process management using Jobs on Windows Posted by Len at 14 Feb 2008 09:25 AM
One of the problems I currently have with CruiseControl.Net is that some of my tests spawn multiple processes; such as server tests which run the development environment, which runs a batch file to start a server (or two) and then...


Living with continuous integration Posted by Len at 31 Jan 2008 08:48 AM
Well, it's about a month since I started running Cruise Control .Net and things have settled down somewhat now and I can almost go a day or two without tweaking my configuration or being tempted to fix issues in Cruise...


Coding the markets Posted by Len at 31 Jan 2008 08:33 AM
Barry (who seems to have stopped blogging) recommended this blog to me; Coding The Markets. It's pretty good if you're into investment banking development stuff....


DNSBL - again... Posted by Len at 15 Jan 2008 12:07 PM
If Richard Wolff is reading this then I can't reply to your emails as your ISP is bouncing my emails with this: Hi. This is the qmail-send program at ns.mgf4.net. I'm afraid I wasn't able to deliver your message to...


CruiseControl.Net patches Posted by Len at 14 Jan 2008 02:25 PM
Hacking CruiseControl.Net to work better for my specific circumstances (lots of projects that depend on lots of projects) has resulted in the following patches to revision 3607 of ccnet which I'm just about to submit to the developers. These patches...


How important is VC6 to you now? Posted by Len at 10 Jan 2008 09:23 AM
I'm working on the next releases of the licensed version of the socket server framework, and I now have continuous integration (of a sort) so my build and test problems are being minimised... BUT... Keeping Visual Studio 6 support in...


Thread.Sleep(100); // sleep for a short while, to avoid hammering CPU Posted by Len at 3 Jan 2008 10:41 PM
I am intending to check out some of the other build servers that people have been suggesting, but today I was too busy with real work so I just left a cut down version of my latest CruiseControl.Net configuration running...


More Cruise Control .Net woes Posted by Len at 2 Jan 2008 06:46 PM
I've almost got something that works out of CruiseControl.Net. Once I'd hacked in some fixes for the project triggers and other stuff that didn't work the way I wanted it to I concentrated on generating the config files that I...


Fighting with CruiseControl.Net... Posted by Len at 21 Dec 2007 09:55 PM
I've been trying to get my code to build with CruiseControl.Net this week. It's taken longer than I'd hoped, but I'm almost there. It became easier when I switched from assuming various parts of CruiseControl.Net would "work as I expected...


CruiseControl.Net Posted by Len at 18 Dec 2007 05:11 PM
I'm currently working on two new releases of my socket server framework, the first is a simple release to add support for VS2008 and the second is the next "feature" release. Due to the number of projects and example servers...


Secure code on vista only for 'enterprise' developers? Posted by Len at 13 Dec 2007 10:02 PM
I picked up a book yesterday, Writing Secure Code for Windows Vista. Which seemed quite interesting, and was a nice slim volume that would slip into my hand luggage for my flight to Geneva on Friday night (yay first ski...


Reclaiming my CPU... Posted by Len at 12 Dec 2007 11:22 AM
I removed the last version of "Norton Anti-Virus" (and all of the other stuff that I've been upgraded into over the years) from the last of my machines yesterday. I've replaced it with AVG, currently the free version to test...


Managed Excel addins Posted by Len at 11 Dec 2007 12:08 PM
One of my current clients has got me drifting back towards my Investment Banking roots by developing an Excel addin for them. Luckily for me it's a banking client with a twist compared to my previous banking clients; they're happy...


Thank you Raymond Posted by Len at 29 Nov 2007 12:02 PM
Raymond Chen has just blogged about "The importance of the FORMAT_MESSAGE_IGNORE_INSERTS flag" over on The Old New Thing. That's another annoying bug fixed ;). I've occasionally wondered why I get some less than informative error messages sometimes, I wasn't passing...


Back in time with DDE Posted by Len at 20 Nov 2007 11:48 AM
After completing some work for client with the custom CLR hosting server I've started looking into a problem for another client, it's a bit of a transition as the problem that he's having is with a DDE connection from his...


Thirteen Patterns of Programmer Interviews... Posted by Len at 20 Sep 2007 01:53 PM
Sad but true... The "Typical Programmer" has a piece on Thirteen Patterns of Programmer Inverviews. I think I've probably been interviewed in all of these styles over the years and taken part in several of them from the interviewing side...


See the "What About .NET?" sidebar... Posted by Len at 31 Jul 2007 04:11 PM
Interesting... It seems that rumours of C++'s demise in the brave new world of .Net were slightly over exagerated, perhaps, maybe... From a recent issue of MSDN magazine: "There are two main reasons why this column was born. First, despite...


VS2008 Beta 2 first impressions Posted by Len at 28 Jul 2007 11:42 AM
I've just installed Visual Studio 2008 Beta 2 in a VMWare box so that I can start to test the x64 port of my socket server framework with the new compiler. I haven't bothered to look into what's new in...


Nick Gunn is blogging again... Posted by Len at 25 Jul 2007 05:13 PM
I used to work with Nick at CSFB and then at Barclays Capital. He's always been a good, techie, low-level COM/.Net geek and his latest writings on the Microsoft Concurrency and Coordination Runtime are interesting! If you're interested in async/multi-threaded/concurrent...


VS2005 breakpoint annoyance Posted by Len at 19 Jul 2007 10:51 AM
My Visual Studio 2005 C++ debugger seems to have stopped doing what VC6 used to do if you placed a breakpoint on a line that didn't result in executable code... VC6 used to warn you and then move the breakpoint...


Infrant Ready NAS NV+ Posted by Len at 18 Jul 2007 09:04 AM
I've been running a pair of 2TB Infrant Ready NAS NV+ RAID systems for a while now as on-site file server and off-site backup and so far I'm very pleased with them. I have one under my desk and one...


Non-trivial... Posted by Len at 18 Jul 2007 08:39 AM
Charles Miller over at 'The Fishbowl' provides a cheat sheet to decode what us programming types mean when we describe the difficulty of solving problems......


CreateFileMapping, Vista, Global namespace, SeCreateGlobalPrivilege... Posted by Len at 10 Jul 2007 09:21 AM
I'm fixing up my performance monitoring code and this uses shared memory to communicate between the perfmon extension DLL and the application. Since I'm tightening up security I decided to explicitly pass in the security attributes, which has a possitive...


Fixing my performance counter library for Vista Posted by Len at 9 Jul 2007 11:43 AM
So, back in June I discovered that my performance counter library code didn't work on my new Vista x64 development box... The problem seems to be that the code has always been doing things in an undocumented/unsupported way and it's...


Pluggable log systems Posted by Len at 27 Jun 2007 09:29 PM
In the past I've mentioned my lack of enthusiasm for the normal 'debug trace' files that some systems seem to include... I pretty much consider them a design smell... But, some of my clients seem to like them and over...


STLPort 5.1.3 and multiple VC versions Posted by Len at 23 May 2007 01:12 PM
I'm just about to try out the latest STLPort release and I went to apply my 'STLPort 5.0 multiple side by side dlls changes' from 2005 and noticed that the place where one of the changes needs to be made...


I'm with Dennis, and Ian... Posted by Len at 16 May 2007 10:17 PM
Given what Jeff wrote recently and what Ian and Dennis said about it... I'm definitely on the Ian and Dennis side of the fence......


A computer magazine that makes me feel like I used to about programming... Posted by Len at 16 May 2007 10:05 PM
I grabbed a couple of copies of "The NT Insider" from my 'not quite got around to reading' rack today and read them on the train on the way in to London. These are the quite short, bi-monthly, driver developer...


UPnP User Interface causes Explorer to hang in My Network Places? Posted by Len at 12 May 2007 10:09 AM
I've been having some problems with Explorer hanging when opening "My Network Places" on some of my machines. Some work fine, some hang. Most annoying. I've been trying a few things over the past few weeks (as and when I...


Taking more of my own advice... Posted by Len at 10 Apr 2007 12:19 PM
I'm continuing to work through my list of things to do for my Socket Server Framework library (and all the libraries that support it) and I've recently got to the 'set up Doxygen and do a bit of documentation' item......


Yay .Net sockets stuff... Posted by Len at 5 Mar 2007 04:35 AM
Nice to see that the new beta, sorry, CTP, of the next .Net Framework will increase the performance of .Net sockets by 70%! Way to go .Net dudes.... Interesting to see that it's a joint effort between the System.Net people...


Hmm, is this really a good fix? Posted by Len at 5 Mar 2007 04:30 AM
Back in July Joe Duffy wrote an interesting piece on the CLR thread pool. I commented on it then, here. He's now written another piece about why they increased the maximum number of threads in "the thread pool" from 25/cpu...


Software failures... Posted by Len at 15 Feb 2007 09:22 AM
I'm in Jackson Hole right now, my skis are still in Denver... Although they've replaced the baggage handling system at Denver International Airport since the days of the classic software project failure, it seems that the current system could still...


Dino Viehland on CLR hosting Posted by Len at 13 Feb 2007 12:13 PM
This is mainly a reminder for me so that I can read this when I get back from Jackson Hole... Dino Viehland has written some interesting looking blog posts on how to implement the thread/task and syncrhonisation host managers for...


Crapness in mscoree.h Posted by Len at 8 Feb 2007 03:49 PM
I'm playing around with hosting the CLR in C++ at present and have come across a bit of crapness in the mscoree.h file... #if (_MSC_VER...


Some interesting stuff from Katie Lucas Posted by Len at 8 Feb 2007 01:34 PM
Here are a few interesting views on software development from Katie Lucas. Via Joel on Software. I especially enjoyed the design methodologies, becoming a manager and "remove developers net access" pieces....


Why do developers still use VC6? Posted by Len at 1 Nov 2006 01:24 PM
Tim Anderson asks why there are so many developers still using VC6... Well, as I said before, if you produce C++ software in source code form and any of your clients require that you support VC6 then it's often easier...


Nerd in a cave Posted by Len at 12 Jul 2006 09:17 AM
This is something that anyone living with a geek really needs to understand. I find it interesting that Rands has his set patterns of behaviour for getting into The Zone in the mornings. I'm very much a creature of habit...


Deadlock detection tool design change for Vista? Posted by Len at 12 Jul 2006 08:54 AM
It seems that Vista contains lots of interesting new Win32 API calls and some of these provide built in support for deadlock detection... I guess my deadlock detection tool can operate differently on Vista then......


CLR thread pool woes Posted by Len at 12 Jul 2006 08:47 AM
Joe Duffy has written an interesting piece over on "Generalities & Details: Adventures in the High-tech Underbelly" about problems with the CLR thread pool. Joe's a program manager on the CLR team at Microsoft, so he knows what he's talking...


IDisagree Posted by Len at 7 May 2006 11:24 AM
Jeremy D. Miller talks about how he dislikes the "I" prefix on interface names and how he'd prefer to ditch it in the same way he's ditched most other hungarian notation. I'm all for ditching hungarian but I actually quite...


Ah, so that's what it's like to make the front page of digg! Posted by Len at 28 Mar 2006 10:00 AM
Typical. My usual subject matter isn't interesting enough to get onto digg.com, etc. but a throw-away post about using Ethereal to catch my partner cheating gets on the front page... Ah well, such is life :) I'll just try and...


VS2005 STL strstream and stringstream leaks Posted by Len at 11 Feb 2006 10:17 AM
Well, it turns out that my initial gut instinct about the leaks that I found in my socket servers when built with VS 2005 was correct. It was an STL thing....


New kind of spam? Posted by Len at 10 Feb 2006 08:02 AM
Recently I've been getting lots of emails from people who seem to think that my company, JetByte Limited, is currently recruiting. We're not now and are unlikely to be in the near future, but that doesn't mean people shouldn't send...


Good stuff Posted by Len at 9 Feb 2006 08:17 AM
Once again I have a list of items flagged for comment in Bloglines but at least this time I have an excuse: "We were on a break!". First is a link from Brad Wilson to where Bruce Eckel writes about...


Sounds like a real nice way to work Posted by Len at 6 Feb 2006 12:51 PM
Noel Llopis, over at Games From Within, has written a nice piece about a typical workday at his work place, High Moon Studios. It certainly sounds like a nice way of working. Unfortunately I haven't been involved in quite that...


More on the socket server leaks Posted by Len at 21 Jan 2006 01:34 PM
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...


Leak plugged Posted by Len at 20 Jan 2006 09:59 PM
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....


Always Produce Posted by Len at 20 Jan 2006 08:12 AM
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...


The best toys always come with an SDK, 2 Posted by Len at 16 Jan 2006 02:54 PM
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...


First tracks Posted by Len at 15 Jan 2006 09:03 PM
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...


Purecall Posted by Len at 14 Jan 2006 01:19 PM
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 a...


A collection of links Posted by Len at 14 Jan 2006 12:16 PM
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....


So that's what it's called Posted by Len at 14 Jan 2006 09:45 AM
Jeremy D. Miller points out that my 'second' style of coding (see here) is called writing a "spike" in XP terms....


Shaping the future of the XLL interface in Excel 12 Posted by Len at 12 Jan 2006 08:21 AM
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...


Excel addins sharing data Posted by Len at 10 Jan 2006 10:58 PM
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...


Beware the momentum of prototype code Posted by Len at 10 Jan 2006 07:53 PM
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...


Detecting the Excel Function Wizard Posted by Len at 9 Jan 2006 07:32 PM
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 testing some of...


Now I'm confused (C++/CLI destructors) Posted by Len at 8 Jan 2006 01:36 PM
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...


Something all C++ programmers should know when using managed C++ Posted by Len at 7 Jan 2006 11:12 AM
Beware! The rules for when a destructor is called for a managed C++ class in Visual C++ are different than for "normal" C++ class....


Grumpy old men Posted by Len at 7 Jan 2006 09:42 AM
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...


iTech Bluetooth Virtual Keyboard Posted by Len at 6 Jan 2006 07:40 PM
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 projects a keyboard onto...


LEGO Mindstorms NXT Posted by Len at 5 Jan 2006 07:23 PM
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...


Programming by contract in C++ Posted by Len at 1 Jan 2006 03:05 PM
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...


Garmin eTrex Vista C communications protocols Posted by Len at 30 Dec 2005 11:08 AM
As I mentioned a while back, I got a Garmin eTrex Vista C handheld GPS as a Christmas present and there's code available from the Garmin website that lets you talk to it via its USB interface. There's also a...


Thought for the day Posted by Len at 28 Dec 2005 12:13 PM
Does anyone in IT use paper clips for anything other than resetting hardware either by pressing those hard to reach reset buttons or by shorting out bios batteries, etc?...


Is it just me, or do the best toys always come with an SDK Posted by Len at 27 Dec 2005 10:35 AM
I got a Garmin eTrex Vista C handheld GPS as a Christmas present. Another cool tool to add to my geeky ski stuff. So far I've only used it to navigate to and from a restaurant yesterday lunch time, but...


Interesting article on deadlock detection in DDJ this month Posted by Len at 24 Dec 2005 03:49 PM
There's an interesting article by Tomer Abramson in this month's Dr Dobb's Journal about deadlock detection. He provides a compile in tool that works in a similar way to my deadlock detection tool and reports on potential deadlocks in...


More thoughts on thread naming Posted by Len at 22 Dec 2005 07:57 PM
I've just finished the first cut of the code that handles the Win32 Thread Naming "API". This means that my debugging tools can now report the name of a thread (if it has been named) rather than just its thread...


On Edit and Continue Posted by Len at 22 Dec 2005 11:59 AM
Dennis Forbes talks about "Edit and Continue" in VS 2005 and asks "Is it, coupled with similar tool advances, making programmers sloppier, though?" I think so......


Pluggable exception handling Posted by Len at 22 Dec 2005 11:27 AM
Ben takes the "throw as an exception dispatcher" idiom to its logical conclusion by presenting a pluggable exception handler. As Ben says "I'm not sure how many situations something like this would be useful in, but it fit the testing...


STLPort 5.0 and multiple VC versions Posted by Len at 22 Dec 2005 09:59 AM
I'm in the process of testing some of my code with Visual Stuio 2005 and the first thing I found that I needed to do was to upgrade my STLPort installation from 4.6.2 to 5.0.0 to get a version that...


Naming Win32 threads - how it works Posted by Len at 20 Dec 2005 07:28 PM
I've been using the SetThreadName() function from the MSDN docs for ages to provide a way of distinguishing between threads in the VC debugger. I always thought it was a bit of a weird 'API' but had never really thought...


I guess I'll file that in the "I didn't know you could do that" pile Posted by Len at 9 Dec 2005 10:49 PM
Ned Batchelder reminds us of the value of the C++ FAQ (Lite). It's been a long while since I've looked at it yet Ned's example shows that I've still a lot to learn about the subtleties of C++. I can...


A change of technologies Posted by Len at 3 Dec 2005 08:45 AM
I started back with an investment banking client this week. I'm working with the team that brought us "the refactoring project" and another small team, and integrating the trade entry system with some "xll" excel addins and some back end...


Udi Dahan on Physical Design Posted by Len at 30 Nov 2005 02:36 PM
Udi Dahan writes about managing dependencies in code at the 'package' level in "So many Dlls, so little time". "Sloppiness with dependencies. If two classes are independent of each other, and do not provide different implementations of the same...


Hosting problems resolved Posted by Len at 25 Nov 2005 09:04 AM
It looks like all of the hosting problems are now resolved. There was a brief period when the database and CGI were fixed and an MT configuration path hadn't been updated so pages were not being rebuilt after comments...


I don't like Vanilla Scoble Posted by Len at 16 Nov 2005 10:38 AM
Robert Scoble, the "Microsoft Geek blogger", has recently had a complaint that he only writes about Microsoft and he figured that he was in a rut and decided to get out of his rut by deliberately not writing about his...


Why are the "event" classes in .Net STILL broken? Posted by Len at 15 Nov 2005 06:01 PM
Whilst I'm ranting about the little things... You still can't create named versions of the .Net ManualResetEvent and AutoResetEvent, even in .Net 2.0. Wasn't everything going to be fixed in Whidbey?...


Too much encapsulation reduces the ability to multiplex? Posted by Len at 15 Nov 2005 04:06 PM
Every now and then I come across a situation where encapsulation has been taken slightly too far. Usually, or at least most recently, these over encapsulated designs have had problems because they've blocked access to an event handle. It's great...


Bad Managers? Posted by Len at 9 Nov 2005 07:24 AM
Alan Green doesn't like the word "manager" used as a class name suffix. His point seems to be that "manager" is imprecise and instead he suggests a list of alternative suffixes with more precise meaning; though they seem to be...


Visual C++ 2005 cannot build dynamically linked applications for NT4 deployment Posted by Len at 4 Nov 2005 12:35 PM
Jochen Kalmbach has discovered a problem with dynamically linked applications built with VC2005 running (or not running!) on NT 4. I guess this isn't going to bite that many people... Read about it here....


Note to self Posted by Len at 27 Oct 2005 04:35 PM
This CodeProject entry is SO full of errors and poor practice that I must find the time to leave a comment on it... [Updated: 29th October] Done. Comment is here....


Evil macros in April 2005 Platform SDK headers Posted by Len at 26 Oct 2005 12:26 PM
I'm upgrading one of my build machines to use the April 2005 edition of the Platform SDK to investigate the implications of this posting over at eggheadcafe.com which states that since Visual Studio 6 ceased to be supported as of...


If you enjoyed the Petzold thing earlier... Posted by Len at 25 Oct 2005 09:50 PM
This may also be your kinda thing. Ellen Ullman's 1998 two part series "The Dumbing-Down of Programming" from Salon archives. Rebelling against Microsoft, "My Computer" and easy-to-use Wizards, an engineer rediscovers the joys of difficult computing. Returning to the Source....


LNK2005: _iswdigit already defined in ... Posted by Len at 25 Oct 2005 09:11 PM
I'm in the process of preparing a release for a client. I've done the work, the tests pass, the stress test runs with flying colours and so I've tagged the source and I'm in the middle of the final build...


Charles Petzold on coding Posted by Len at 25 Oct 2005 10:58 AM
Charles Petzold recently delivered a talk at the NYC .Net Developer's Group and he's made it available online here "Does Visual Studio Rot The Mind?". It's an interesting read, especially if you actually remember writing early Windows GUI applications and...


Walking Managed Stacks with the Profiling API in v2.0 of the CLR Posted by Len at 9 Oct 2005 11:24 PM
It seems to be stack walking week; what with Ned's posting earlier about walking an unmanaged stack and now this excellent piece by David Broman on doing the same in with managed code....


I don't think I've ever been disagreed with in Japanese before Posted by Len at 9 Oct 2005 10:02 PM
The discussion on Assert goes on, this time in Japanese... Google's language tools lead me to believe that they're disagreeing with me. They seem to be pretty shocked that I'd take this stance and appear happier when Noel puts me...


Throwing the baby out with the bathwater Posted by Len at 8 Oct 2005 12:55 PM
Richard Hale Shaw writes on using statements in C# and his conclusion is "it's too confusing" and "I'd suggest not even using using statements". I think that position is a little harsh, but I think that the main problem is...


More on locking Posted by Len at 7 Oct 2005 08:11 AM
Jeff Darcy over at "Canned Platypus" writes about "How to add locking to a program". He laments the lack of a reasonably priced deadlock detection tool. I assume, from his backgrond, that he's interested in an Linux tool, so my...


Walking the call stack Posted by Len at 7 Oct 2005 07:23 AM
Ned Batchelder has written about the code he uses to get a call stack out of a windows program (thanks for the link Barry). I've added a snippet of the code I use as a comment to his post. I...


MT-Blacklist Posted by Len at 7 Oct 2005 06:45 AM
It seems that Jay Allen has shutdown both MT-Blacklist and the 'master blacklist' due to bandwidth problems caused by either a denial of service attack or inconsiderate developers. Jay hosted a regularly updated file of regular expressions that powered the...


Jeff Darcy on Linus on specifications Posted by Len at 3 Oct 2005 03:07 PM
Jeff Darcy over at "Canned Platypus" has written a nice piece on specifications and how Linus has got it wrong. Any post that contains the phrase: "... who wouldn’t know good code if it got into a robot and literally...


Asserts are evil, except when you have no other choice Posted by Len at 3 Oct 2005 09:39 AM
Noel Llopis over on "Games from Within" has written a nice rebuttal to my Asserts are evil post and the follow up. I think it's probably about time to wrap this up ;) So, here's what I've learned... [Updated: 24th...


Once again I've been too busy to comment on these during the week Posted by Len at 1 Oct 2005 11:15 AM
A collection of blog posts that I flagged for follow up this week....


Is Raymond Chen's use of Assert valid? Posted by Len at 28 Sep 2005 10:04 AM
I'm sure you're all getting bored on my views on using Assert in modern C++ code by now, I'll try and make this the last one. Last time, I asked if anyone had what they'd consider to be an example...


More from Mark and Barry on Assert Posted by Len at 27 Sep 2005 09:22 PM
Mark responded to Barry's response to my post on Assert. Barry then responded to Mark and Kim and I added a little more in the comments. I did have some more to say, but Barry's said most of it... Anyway,...


Common knowledge to many, but... Posted by Len at 27 Sep 2005 09:06 PM
Alexis Smirnov has just written a piece on why you shouldn't try and use STL's map::operator[] to find out if a map contains a particular element. It's probably common knowledge for most people using STL, but it's worth repeating for...


Barry's take on Assert Posted by Len at 26 Sep 2005 07:59 AM
Barry Lapthorn has a response to my Assert is Evil posting where he concludes that assertions aren't needed if you have tests... He also raises a point that I missed which is that the typical assert on Windows machines causes...


Good stuff Posted by Len at 24 Sep 2005 10:06 AM
I use BlogLines to read my RSS subscriptions. It's pretty good, and now that the performance issues I had initially seem to have gone away, I like it a lot. It's very handy to be able to read my feeds...


Opera lover Posted by Len at 22 Sep 2005 09:53 AM
The Opera web browser is now free. It's worth giving it a try. I downloaded it after Barry sent me a link to the free registration codes that they were giving away a few weeks ago to celebrate their 10th...


AdSense preview tool Posted by Len at 22 Sep 2005 09:38 AM
The Google AdSense Preview Tool does exactly what it says on the tin. So it's very useful for working out what kind of ads you'd get if you added Google's AdSense to your pages....


New C# v3 features explained in context Posted by Len at 22 Sep 2005 09:02 AM
Ted Neward has a very nice piece about the new language features in C# v3 and how they work together to provide something quite powerful. Go read it! Given that implicit typing, object initialisers and extension methods are all designed...


Restricting the use of extension methods? Posted by Len at 19 Sep 2005 11:37 AM
Having looked through the slides that Vagn pointed me to in a comment to my recent post about C# v3.0 Extension Methods I can understand, a little more, about the reasoning behind the change to the language. Given that the...


Concepts and C++ Templates Posted by Len at 18 Sep 2005 07:45 PM
The slides from Herb Sutter's C++ Futures talk (TLN309) at this year's PDC refer to "Concepts" in C++ templates; for me this is a much more useful addition than the auto keyword repurposing. I'm sure this is something that would...


Whilst I'm on the subject of code communication Posted by Len at 17 Sep 2005 12:19 PM
I've never really got to grips with the STL's algorithms; actually that's not strictly true, it's really just for_each() that I have most problem with. To me, code that uses for_each() simply doesn't communicate as clearly as code that uses...


Sacrificing precision for ease of use? Posted by Len at 17 Sep 2005 11:15 AM
I'm probably jumping the gun a little here as I can't find Herb Sutter's slides that Matt Pietrek is referring to, but... Once again I find myself asking why is it actually useful to repurpose the auto keyword in C++......


C# v3 Extension methods, syntactic sugar for the lack of free functions? Posted by Len at 16 Sep 2005 03:12 PM
There's a lot of noise coming out of the Microsoft PDC right now. Something that interested me was the future direction of C#; you can grab the spec from here. It seems they're adding "extension methods" which, to me, appear...


Overriding virtual functions, C# is better than C++ Posted by Len at 16 Sep 2005 12:22 PM
I've been merging my UDP framework development branch back to main, building all of my example servers and running all of the "black box" server tests. In doing so I've experienced the pain of changing virtual function signatures. This is...


Does the arrival of Google Blog Search mean blogs will be removed from the main Google results? Posted by Len at 14 Sep 2005 09:00 AM
Google have a beta of blog search engine up and running here. It looks good, seems to work and does pretty much what you'd expect. I'm left wondering why it's needed though... After all, how to you define a blog?...


Assert is evil Posted by Len at 12 Sep 2005 10:58 AM
Christopher Baus has been away and whilst he was a away his HTTP proxy shutdown due to a bug which caused an assert and his site was unavailable. Personally I abhor assert; but I completely agree with what Chris is...


More thoughts on change and typedefs Posted by Len at 10 Sep 2005 08:49 AM
Of course, now that I'm well into using the "option 4" I start to remember why I kept sliding back from options 2 and 3 towards 1. Although option 1 uses native types instead of typedefs which is bad for...


Pimp my hide Posted by Len at 9 Sep 2005 11:20 PM
As some of you may have guessed, the fact that I've spent the last week working on a tool for my own use means that I'm a little light on client work right now. If anyone needs a Windows C++...


In summary, don't summarise too soon Posted by Len at 9 Sep 2005 10:54 PM
I've been working on my deadlock detection and lock monitoring tool quite a lot this week; that and fixing the issues that it's been highlighting. Yesterday I decided that I was drowning in data and that I really needed a...


Change is good Posted by Len at 9 Sep 2005 12:17 PM
I like to experiment with new coding practices. Not too many at once mind you. I tend to add one new thing to how I work, operate in the new way for a while and then decide if the new...


Lots of answers but little help Posted by Len at 8 Sep 2005 06:18 PM
I don't read many newsgroups, I don't have the time, but I take notice of the Windows networking ones as they're low traffic and they're relevant to a lot of the work I'm doing at present... I've noticed something that's...


What's with CreateProcess and managed exes? Posted by Len at 8 Sep 2005 10:06 AM
I have some code that launches another process in a suspended state, does some stuff (tm) and then resumes the process. This uses CreateProcess() and works fine on unmanaged exes. When I try and launch a manged exe with the...


Viewing lock lifetimes Posted by Len at 8 Sep 2005 08:34 AM
I added some more monitoring to the deadlock tool. You can now view the entire life cycle of the locks, from initialisation, through usage to destruction. The lock usage figures put the contention figures in context as you can see...


Observing lock contention Posted by Len at 7 Sep 2005 02:39 PM
The deadlock detection tool that I was working on last week is coming on nicely. I managed to locate two potential deadlocks that had never caused any problems in code that is running live on a client's site. Once I...


I've been lazy this week Posted by Len at 2 Sep 2005 08:46 AM
As I mentioned in an earlier posting I've been working on a tool this week. I'm too lazy to do a job manually and so I decided to write a tool to help me do it... The tool is designed...


Make sure you are doing RAII properly Posted by Len at 1 Sep 2005 11:48 AM
There's an interesting post over on the Joel On Software forums about RAII in C++. The original poster's problem is clearly stated in the first line of their question: When the constructor for CTheClass runs, I want to acquire 3...


Reader Questions Posted by Len at 1 Sep 2005 11:34 AM
Ahsan Askari asked the following in a comment to one of yesterday's posts: Just like to know whether you use external libraries specially 'BOOST' in your commercial projects and related pros-n-cons ? Also i like to know your initial strategy...


Lots of things become unnecessary if you factor things correctly Posted by Len at 31 Aug 2005 07:06 PM
I'm still reading someone else's code and it just struck me that a lot of 'strange' coding practices become unnecessary if you factor your code 'correctly'. Note that both 'strange' and 'correctly' live in the Len::Personal::ViewOfTheWorld namespace... Take this, for...


I just don't get it, what's with this->? Posted by Len at 31 Aug 2005 09:29 AM
I'm looking at some code to help me understand how to use the dbghelp.dll Windows stack walking and symbol discovery stuff and the code I've found on the net uses a programming style that I've seen a few times before...


It's obvious when you think about it, but Posted by Len at 31 Aug 2005 09:01 AM
Piracy is not an enemy until you are famous. Until that point, obscurity is your enemy. I think independent creators should spend all of their attention fighting obscurity until they are famous, and only then should start to worry about...


The price of freedom is eternal vigilance. Posted by Len at 23 Aug 2005 03:35 PM
Kevin Barnes has written a nice piece on "freedom" languages, his word for Ruby, Python, Perl, etc. He compares these with "safety" languages, such as C++, C#, Java, VB, Delphi. He starts off by saying "I picked the terms freedom...


JLR on C++ interfaces Posted by Len at 23 Aug 2005 07:20 AM
A while ago I came across JLR's weblog and read his three postings using interfaces in C++ (1, 2, 3). I fired off a quick comment on the first article because I didn't agree with a couple of things he...


While Windows lives, it's hard to see how COM will ever die. Posted by Len at 22 Aug 2005 03:28 PM
This is a nice piece by Tim Anderson on why COM is still alive and kicking despite what all the .Net-heads would have you believe... It always seemed to be pretty obvious to me that all the "COM is dead,...


It's the libraries, stupid Posted by Len at 19 Aug 2005 03:16 PM
Jeff Atwood has a nice piece on the productivity of different programming languages (go read it). His sums up with the following: Given .. 1). the abandonment of C++ and C for mainstream programming 2). the huge influence of individual...


Joel is a bit confused about agility and design Posted by Len at 18 Aug 2005 09:24 AM
Joel Spolsky of has just completed a very public product development project for a Windows based user assistance program called CoPilot. This has been interesting to watch and has, no doubt, generated lots of positive PR for him. He's just...


I wonder what the rationale for this restriction is Posted by Len at 17 Aug 2005 07:09 PM
Geoff Appleby discovers that a common C++ template idiom doesn't work with .Net generics. The code that doesn't work is this: Public Class Class1(Of V As System.Web.Services.Protocols.SoapHttpClientProtocol) Inherits V End Class which is the .Net generics equivalent of this common...


Garbage Collection and Pointers Posted by Len at 12 Aug 2005 07:26 AM
So, Richard Hale Shaw is helping us move away from C++ and in his latest posting on the subject he explains how "veteran C++ programmers" don't like to manage memory themselves; hmm. I'd quite like to see his sample data....


Borland C++ v3.1 and "The Raymond Chen Camp" Posted by Len at 11 Aug 2005 11:06 AM
Last weekend was a bit of a "compiler weekend" for me; I started playing with VS 2005 and I found some old source code and wanted to build it and that required Borland C++ v3.1 (In the currently fashionable style...


First impressions of Visual Studio 2005 from a C++ point of view Posted by Len at 10 Aug 2005 04:45 AM
I've been using the latest Visual Studio 2005 beta on and off for the last couple of days. This is the first time I've bothered to try "Whidbey" and my initial impressions are very favourable; I'm just using it for...


I feel the need to comment on this... Posted by Len at 8 Aug 2005 08:49 AM
Richard Hale Shaw continues his series of blog postings on "Moving away from C++" with the obligatory "pointers are bad, garbage collection is good" post... I feel the need to write something about this but not yet, I have work...


/Y3 where have you been all my life Posted by Len at 2 Aug 2005 08:54 AM
I was just flicking through some of the entries over on Games from Within and I came across an entry on precompiled headers which is a good introduction of the pros and cons of using precompiled headers in a cross...


Threading flames Posted by Len at 30 Jul 2005 09:48 AM
Thanks to Ned Batchelder for pointing out the "discussion" about the pros and cons of multi-threaded programming over on the SQLite newsgroup. The comments on Ned's post are well worth reading; they've provided me with a new blog to subscribe...


On the bandwidth wasted by poorly designed spam software Posted by Len at 30 Jul 2005 06:40 AM
I've been watching my web server logs in real time for the last couple of days, not intently; I do have a few slightly more interesting things to do. I've had a tail of the logs running on the laptop...


Blog Explosion just doesn't do it for me Posted by Len at 29 Jul 2005 09:05 PM
I've been attempting to boost the number of people reading this blog in the last few weeks. Mainly because the more people there are reading the more likely I am to get feedback in the form of comments and postings...


Whilst on the subject of deadlocks Posted by Len at 28 Jul 2005 07:56 PM
It must be a deadlock kinda day. Pete McKinstry points to a Java deadlock avoidance scheme which involves knowing and using a total ordering of the locks that you wish to acquire. This is similar to Andrei Alexandrescu's C++ idea...


Visual C++ 2005 loses single threaded CRT Posted by Len at 27 Jul 2005 03:10 PM
From C++ Potential. In a posting about changes to the compiler switches in Visual C++ 2005 Brandon mentions that they've removed the single threaded C runtime library options. Does anyone out there use the single threaded CRT anymore? I can't...


Result should be const ? conditional operator : if then else Posted by Len at 27 Jul 2005 09:27 AM
Simon says; I've stopped using ?: because it isn't as readable as an if .. then .. else. ... I, personally, don't find the readability of the conditional operator (?:) a problem. No more than I find readability of assignments...


Blogs as conversations and how blog search can help fill in the gaps Posted by Len at 26 Jul 2005 02:57 PM
Robert Scoble, and others, are discussing blog search engines at present. It's quite interesting to see that there are lots of different approaches to the same problem. Mary Hodder's article is good in that it explains a bit about the...


This should be interesting Posted by Len at 25 Jul 2005 06:57 PM
Richard Hale Shaw is writing some blog entries about moving away from C++ (to .Net). But then he would say that, wouldn't he. His job includes providing courses for people learning .Net... ;) Anyway, I'm sure it'll be an interesting...


No, that's not the point, and yes, trace logging IS bad Posted by Len at 21 Jul 2005 10:50 AM
Sahil Malik doesn't agree with Jeremy Miller's description of excessive tracing being a code smell. He suggests a 'neat' way to get around the problem but, IMHO, he's completely missing the point, and I've said as much before. Oh, and...


What's wrong with my CSS? Posted by Len at 20 Jul 2005 08:57 PM
My <pre> styling looks OK (to me at least) in IE 6 and horrible (double spaced and strange) in Firefox. Can anyone tell me why?


The 'full articles' feed is now feeding full articles again Posted by Len at 18 Jul 2005 06:34 PM
Seems like I broke it when I added the GoogeAds for that feed... RSS 1.0 (full articles) RSS 2.0 (extracts)...


So, where's the Unix version of CodeProject? Posted by Len at 30 Jun 2005 10:49 PM
Software development is hard. Lots of details that are hard to get your head around and harder to simplify. CodeProject is a wonderful resource for Windows programmers where programmers try and make the complicated more simple for others; I view...


Linux's Dll hell? Posted by Len at 30 Jun 2005 10:44 PM
I've been playing with Linux this week. The last time I played with Linux was back when it fitted on 15 floppy disks; I think I still have the 15 floppy disks in Dad's office somewhere. It's come a long...


And now for something completely different Posted by Len at 28 Jun 2005 11:10 PM
One of my clients has asked me to do some investigative work for them in relation to Linux running on a Vortex86-6071LV (a PC/104 format PC which is 386 PC on a board that's around 6" x 4" x 1/2")....


Is bloglines always slow? Posted by Len at 25 Jun 2005 12:36 PM
I've been using SharpReader as my RSS reader for ages. I downloaded a version of it way back when I first got into blog reading and stuck with it because it worked, to a fashion. I ignored the bloaty .Netness...


0xFF 0xFE -> CVS -> 0xEF 0xBB 0xBF Posted by Len at 17 Jun 2005 10:21 AM
My project house-keeping yesterday ended up with a rather strange discovery. I have some test log files that contain Unicode characters and are stored on disk as UTF-16 with the correct 2 byte 'byte order mark' (BOM) header of 0xFF...


Working on the borders Posted by Len at 17 Jun 2005 09:32 AM
As anyone who has downloaded any of my code from here, or my company site or CodeProject will know, I have a particular way of doing things. The code I write tends to follow a particular style and as such...


Catching my breath Posted by Len at 16 Jun 2005 09:56 AM
I've had a busy few weeks. I'm waiting for a client to come back to me about a quote for some work and whilst I'm waiting I'm putting together a prototype for a product that I'm interested in producing. The...


Code Generation Posted by Len at 4 Jun 2005 11:35 AM
I've spent much of this week moving from a hand crafted prototype to a code generated version of the same code. The code is all repetitive boiler plate, sort of like the stuff that MIDL generates for you. The code...


Static linking Posted by Len at 31 May 2005 10:22 AM
Christopher Baus bemoans the problem of getting all the libs that he wants to use linked in statically on Linux. Chris wants an executable that will run on lots of different systems with the least amount of pain for all...


Stan Lippman's VC6 rant Posted by Len at 17 Dec 2004 10:12 PM
It's been a busy week. We got back from Verbier on Saturday and I'd hurt my knee, so I was sad, and limping and slow. I then had a mass of things to do to finish all of my client...


Stage complete - time bonus Posted by Len at 17 Dec 2004 09:54 PM
Today was my last day with one of my current clients. In the end the hand over went well, but then I did start the process off a long time ago.......


C++ Meta programming madness? Posted by Len at 17 Dec 2004 07:50 AM
I find myself agreeing with Chris on this one. I just dont think I'm clever enough to use these 'modern' C++ template programming styles reliably in a way that makes the resulting code better and easier to maintain by others....


Busy Posted by Len at 1 Dec 2004 10:44 PM
I've been busy recently; what with getting our trip sorted, finishing the hand over, completing the auction server and doing some consultancy for an internet market data providing company. The good news is that most things are now done and...


Spammer's choice Posted by Len at 24 Nov 2004 09:49 AM
I'd quite like to be able to harness the efforts of the comment spammers and MT-Blacklist so that when a spammer fails to comment on a posting this fact is noted and posting can get mentioned on the front page as the current "spammer's choice"... Sounds mad, but since I have a lot of content now, it would be a way of bringing some old stuff back to the front page - in the same way that the comment section does...


VS.Net #Region Posted by Len at 19 Nov 2004 07:37 AM
I'm reviewing some code for a client. I've decided that I don't like the #Region functionality from the VS.Net IDE... It seems to be another 'sticking plaster' to help make things 'easier' for people to structure code in inappropriate ways...


Smash it up Posted by Len at 5 Nov 2004 07:14 AM
I completely agree with Jeff on this one. Fear of breaking code can hold you back from making the kind of changes that are required to keep the code alive.


NetMeeting Data Channel sample code Posted by Len at 4 Nov 2004 07:59 PM
I've uploaded a new copy of the NMPing.zip file that is mentioned in this article. It seems that it was corrupted. Sorry about the delay in doing this, I'd forgotten about it. The code's very old, so be gentle with it.


I don't usually do the meta-blog thing but... Posted by Len at 28 Oct 2004 11:36 PM
I sympathise with Christopher Baus' frustrations...


Baus waves at Scoble Posted by Len at 28 Oct 2004 11:15 PM
Christopher Baus suggests that Robert Scoble's blog lacks focus and that his blog is mostly noise, "He's always blogging about something, but really nothing at all ". But Chris, surely that's the point of Scoble's blog? As Robert himself says "if you don't think I'm taking you to enough cool blogs, or writing enough cool stuff, there's a very easy solution. Unsubscribe.". I did that quite a while ago, but I'm glad he's still out there and that other people subscribe to him on my behalf...


This is the book I've been waiting for Posted by Len at 8 Oct 2004 08:20 AM
Excellent news; Herb Sutter and Andrei Alexandrescu's C++ Coding Standards book is done! This is the book I've been wanting for ages. Whilst there are other C++ coding standard books out there but, well, they just don't have the gravitas of a book written by these two and included in Bjarne Stroustrup's C++ In Depth Series. The table of contents is here. I hope the book's heavy enough to hit people with ;)


Harvest for reuse Posted by Len at 17 Sep 2004 08:00 AM
Jeff Atwood writes about the the delusion of reuse where he warns of the extra effort that's really required when writing for reuse: "I believe writing a truly reusable class is an order of magnitude harder than writing a single use class."


Could someone please Posted by Len at 16 Sep 2004 07:50 PM
Could someone please write a Java based estimating package? I really want to be able to able to turn to a manager and say, with a straight face, that all of my estimates were done in JEst... Sorry, it's been a long day.


How hand overs become hand offs Posted by Len at 10 Sep 2004 07:27 AM
Being a consultant, I find that the start up and shut down of projects are usually the most stressful times. Start up is all about "hitting the ground running", learning lots of stuff really fast and making a good impression. Shut down is all about hand over. Shut down is the hardest because you need the cooperation of the people you're handing over to. Whilst you can pretty much deal with any issues during the start up phase just by digging deeper or working harder a hand over with no cooperation just becomes a hand off.


The good thing about blogging is Posted by Len at 10 Sep 2004 06:32 AM
It makes you think. I find that when I've done a brain dump post like last night's "loader lock" posting, all of the issues are fresh in my mind. Posting just before bed means that by the time I wake up I've usually come up with lots of new ideas about the thing I just posted about...


Why does windows hold the loader lock whilst calling DllMain? Posted by Len at 9 Sep 2004 10:10 PM
I've been splunking around Dll loading recently for a pet project. It's been an interesting journey and this evening I solved the final piece of the puzzle and, when I did, I suddenly wondered, not for the first time, why Windows holds the loader lock when calling DllMain()...


WTF? Posted by Len at 8 Sep 2004 07:50 AM
Ah, a place to keep all that bad code... The Daily WTF From Barry


LoadLibrary error Posted by Len at 5 Sep 2004 10:15 AM
I need to dynamically load a dll, grab some function pointers and do stuff; simple stuff, done it 100s of times before. I decide that this time I'll wrap the HMODULE that I'll need in a class to make sure I can never forget to call FreeLibrary() on it - RAII is your friend. It's Sunday, I'm feeling righteous so I'm doing it in a TDD style. I write some tests, load a dll, load a bad dll to check error handling, load a dll that doesn't exist... So, what do you expect happens when you call LoadLibrary() on a file that isnt a valid dll or exe image?


Doxygen niggles Posted by Len at 28 Aug 2004 02:16 PM
I've been using Doxygen recently. It can scan a body of code and produce reams of linked documentation and diagrams. I, personally, don't really use it for its documentation, just for its diagramming. I've always believed that if I can't draw a neat and tidy picture of the relationships between pieces of code then the design needs fixing.


Platform, push off Posted by Len at 28 Aug 2004 10:01 AM
However, I still prefer that all these technologies should be introduced and made exclusive into Longhorn, because of the enormous benefits a comprehensive base platform provides. By requiring an upgrade, Longhorn would cause a mass shift to a new platform and offer developers a new minimum level of operating system functionality, a la Windows 95. From .Net Undocumented Riiiiight... I'll remember to tell all of my clients who are only just finishing moving from NT 4 that they'll need to move everyone again real soon now because it'll be more convenient for developers...


Brute force marshal by value Posted by Len at 21 Aug 2004 12:16 PM
This week I integrated the new data provider with the rest of the client's existing code. The integration was pretty easy as the existing code deals with the data provider via a single method on a COM interface. All that was needed was to adjust the calling code to use the COM object rather than the local implementation and everything just worked. The good news was that the call to get the data was now 100 times faster than it was with the old code; the bad news was that processing that data took almost three times as long. The end result was that the whole process was slower rather than faster... The wonders of COM and the construction of the data object we were using meant that each call to access the data now had to cross process boundaries...


Excellent piece on exceptions Posted by Len at 17 Aug 2004 07:45 AM
IanG on Tap: When to Catch Exceptions - the answer is, of course, not as often as you'd expect... Ian's talking about managed code as can be seen from his final comments about expecting to see many more finally blocks than catch blocks, of course, in a proper language ;) like C++ you don't need any try blocks at all as RAII will deal with all your resource management for you...


The Exponential Nature of Lines of Code Posted by Len at 16 Aug 2004 10:54 PM
The faster your codebase grows, the less of it people will understand. When people don't understand all of the code, they don't see global patterns, and so they will reinvent little wheels all over the place. In theory, the development leads and the architects are supposed to watch out for these issues, but there are always places where redundant code can hide, and as the code continues to grow, even this watchdog function breaks down. Soon you have people who are intimately familiar with only a couple of modules in the system, and so replication across modules becomes difficult to spot. As the line-count continues to rise, the percentage of the code that each person really knows decreases, compounding the problem. Welcome to exponential code growth. From Jason Marshall's Software Weblog via Ned Batchelder


Failed Posted by Len at 5 Aug 2004 07:27 PM
On Tuesday I wrote about the start of this week's gig. Now that the week is over I guess an update is in order. In summary; I failed to work miracles this week...


Caring Posted by Len at 4 Aug 2004 08:30 AM
There was a good reply by Dr. Real PC on one of Joel's discussion threads recently; "The most important thing is caring. If you don't care it doesn't matter how smart you might be. If you aren't interested how could you have the patience that's required?" How true. I think it's reasonably easy to spot if someone cares about what they're doing, or, perhaps it's just easy to spot when they dont...


Sick of the R word Posted by Len at 4 Aug 2004 08:08 AM
I'm getting a bit fed up of hearing the word 'Refactoring' when what people really mean is just 'hacking at code'. Back in May last year I responded to Bob Cringely's piece on how bad the whole idea of refactoring was; I still stand by what I said and, looking back, I think the key point is this: "Not all code changing is refactoring. Refactoring requires discipline. You need to balance the risk of refactoring with the risk of not refactoring. You need to know when to stop and you need to do it because it's the right thing to do for the project, not just because you can. Changing code without this kind of thought and discipline is just hacking (in the worst sense of the word)." Unfortunately, now that 'Refactoring' is trendy, everyone refers to every little hack job as 'Refactoring' because it sounds so much cooler to management... I think that's a pity; it devalues the term. When Refactoring is done well it improves the quality of the code base; when every little change is 'Refactoring' then it has at best a neutral effect on the quality of the code.


Explicit class initialiser methods Posted by Len at 24 Jul 2004 10:48 AM
Codemonkey uk has an interesting piece on the use of explicit initialiser and destroy member functions rather than allowing object lifetime to be managed by the constructor and destructor.


Reprint: CORBA - Reference Counting Posted by Len at 24 Jul 2004 10:19 AM
A new posting in the blast from the past reprints area. First in a series that compares CORBA and COM; CORBA - Reference Counting.


/FI, STLPort, Precompiled headers, warning level 4 and #pragma hdrstop Posted by Len at 24 Jul 2004 07:20 AM
The one where I find that you can teach an old dog new tricks and almost use the 'rocks' word.


Comment Spam Morons Posted by Len at 21 Jul 2004 07:58 PM
Hey, you comment spam morons, get a life and do something useful for a change. With MT Blacklist most of you are kept out (and I can see how effective it is from looking at the logs) and it takes me no time at all to clean up after the few of you that get through and post your pathetic excuse for advertising. One click on the email that I get sent when a comment is left adds your pathetic spoor to my blacklist and another click scans all other comments and removes the crap you're spreading. ZZZzzz...


Not Invented Here or just Not Usable Here? Posted by Len at 2 Jul 2004 07:03 PM
Reusing code is often harder than you'd think. Sometimes the decision not to reuse a piece of code but instead to write new code to do the same thing is not just a case of 'Not Invented Here' syndrome but is more a case of trying to 'Use Someone Elses' and finding that the fit isn't quite right...


Currently reading Posted by Len at 27 Jun 2004 04:03 PM
I currently have 3 quite different technology books on the go, and one waiting in the wings. I'm re-reading Software Craftsmanship, McBreen's ideas really appeal to me, but then I guess that may be because I went through an official apprentiship in a former life so I can see how the craft model might work well for software. Next is Applied C++ which is an interesting 'warts and all' journey through the design of a graphics manipulation library in C++. I particularly like the fact that the authors don't necessarilly give you any hints when they're exploring a technique that they will later discard; it's nice to sit there thinking "you don't want to do it like that" and then have them agree with you later on... The third book is Programming the Windows Driver Model. Which is an interesting change from all things .Net. I've also got Developing Windows NT Device Drivers to read but haven't started that one yet.


Staying focussed on the finish Posted by Len at 24 Jun 2004 08:32 AM
The data provider project rolls on and we're almost at 100% of the functionality required for version 1.0. In fact, we have a few 1.1 features in there because they were easy wins and by the time we made sure that we they'd be easy to do in 1.1 we found we'd done 90% of the work for them. The task now is to avoid the numerous distractions, improve test coverage, integrate with our clients and hitting the ship date.


Code that's like a box of Lego Posted by Len at 23 Jun 2004 11:15 PM
I've been noticing that since I started doing the testing thing in anger my objects tend to be smaller and I have more of them. The pressure that testing puts on you to design in such a way that each object can be used as independently as possible so that you can write tests seems to break chunks of functionality far better than other design methods I've tried. As I've said before, the problem then becomes one of managing the obvious complexity; looking at this kind of code for the first time can be a little daunting.


Firm Foundations Posted by Len at 21 Jun 2004 11:01 PM
As I mentioned last week, I'm writing a new component for one of my clients. I also mentioned that 'beyond the interface, I can do what I like'; that's actually a surprisingly important part of the specification due to the situation that the client finds itself in...


Repeat after me, COM is just an interface layer Posted by Len at 17 Jun 2004 11:43 PM
I was reading this the other day and I recognised Past Mozilla Mistakes: two as something that quite a few (if not all) of my clients have made...


Joel on Win32; API complexity and the Army of Muppets (a rant) Posted by Len at 17 Jun 2004 10:44 PM
Joel has written a nice little piece on the demise of the Win32 API. Some of it I agree with; such as for many developers the fact that .Net is just the latest example of Microsoft indulging in a Fire and Motion exercise, yet for other developers it's vitally important; the trick, as ever, is working out which camp you fall into... But some of it, I don't.


Pimply youth Posted by Len at 15 Jun 2004 08:16 AM
Last week I spent some time back with the guys on the refactoring project. Things are going well for them and, apart from a few minor transgressions, they're sticking with the process that we put in place when I was with them on a regular basis. The project is currently suffering from a slight lack of technical direction; they have a new guy on the team and he's enthusiastic to try 'new' things and nobody is currently restricting the things he is allowed to try...


This still amuses me Posted by Len at 5 Jun 2004 08:57 PM
A long time ago, in a galaxy far, far, away... I wrote a short review of The C++ Programming Language, 3rd Edition. Which, for some strange reason, Addison Wesley decided to quote on their page for the book in question (click reviews, the page is too clever to allow a direct link), along side an Amazon review and a review from Computer Literacy Bookshops... I laugh every time I stumble across that page...


Block Posted by Len at 19 Apr 2004 10:46 PM
My brain has been too busy to think recently. I've had too many background issues going on, too many unresolved items, too much shit to deal with. I haven't been able to think new things because I've been too tied up in the unfinished things, I've tried really hard to think but there wasn't any space... It sucked. Today I cleared a lot of that away; I found closure on lots of items and generally would be able to think nice shiny new thoughts right now if I hadn't relaxed with a little too much wine over dinner. Ah well. Come tomorrow the wheels will be spinning freely again and things will start to flow...


Designing to be inherited is extra effort Posted by Len at 17 Apr 2004 12:58 PM
I saw this rather nice explaination for why sealed is used in so many .Net classes over on cincomsmalltalk.com as a comment to a rant about how .Net is bad for your design skills... Designing to be inherited is extra effort [Shane King] April 16, 2004 20:26:54 EDT It's extra effort, since you have to think about not only what public interface to provide to users of the class, but also what interface to provide for people who want to inherit your class. Often it's just not worth putting in that effort. Marking your class as sealed is a way of saying "I didn't have the time or inclination to ensure that you can inherit this in a reasonable fashion, so I'm not going to let you do it at all". It's not telling your users what they should and shouldn't do as such, it's admitting you don't know enough to allow them to inherit, and so not letting them do so. Which is IMO a better decision than letting them do it anyway, and then getting stung when you have to change the class in a way that breaks the classes that inherit from you. It seems like a resonable position, but personally I'd prefer it if sealed were just advisory and the user could decide to go against the designer's wishes if they wanted to try their luck...


MT-Blacklist Posted by Len at 16 Apr 2004 07:45 PM
Well, so far I'm very pleased with MT-Blacklist. It works well at preventing comment spam and when some spam gets through it's very easy to update the blacklist and then run the 'despam' option to remove all traces of the offending material. 10 out of 10!


SOA, coupling, flexibility and discipline Posted by Len at 16 Apr 2004 07:43 PM
Some thoughts on Service Oriented Architectures and how for some people the silver bullet du jour is the only tool in their toolbox... Just a bit of a rant really...


MT-Blacklist Posted by Len at 4 Apr 2004 08:17 PM
Sorry about the comment spam whilst I was away. I've now installed MT-Blacklist, so hopefully the only offensive rubbish and stupid sales-pitches on this site will be my own... MT-Blacklist seems pretty good; it cleaned up the mass of spam with one click but then unfortunately failed to block a new piece of crap that was posted this afternoon. Having added one of the offending urls to the blacklist I ran the cleanup again and it removed the offensive comment and automagically added the other urls that the comment contained to the list... I'll write more about it once I've more experience of it...


True, even if beauty is in the eye of the beholder Posted by Len at 23 Mar 2004 08:01 PM
“I'll bet you that from ten feet away I can tell if a program is bad. I might not guarantee that it is good, but if it looks bad from ten feet, I can guarantee you that it wasn't written with care. And if it wasn't written with care, it's probably not beautiful in the logical sense.” Charles Simonyi


Code review Posted by Len at 20 Mar 2004 10:05 AM
I'm reviewing a large body of code for a client at present. It's a general review of the design, coding style, code correctness and testability of a project. I started off by making notes on some of the general design changes that I'd recommend and eventually got down to a detailed review of the code. There's a lot to say about the code and, as with all code, sometimes it's hard to figure out the reason behind the use of a particular construct. I was starting to think that the note taking was going to take an age when I realised that there was a much more concise way to record my thoughts on what was wrong with the code. I changed it.


Const correctness Posted by Len at 16 Mar 2004 07:57 PM
Interesting thread over on Joel today about using const, or not. The original poster asked how many people bothered to mark function parameters that they don't modify as const and whether there was any performance or readability advantages in doing so. Ignore any performance issues, making your code const correct has massive readability and comprehension advantages. I'd go so far as to say it's one of the most important coding standard issues there is...


Cypher Posted by Len at 13 Mar 2004 01:03 PM
I'm currently working with a corporate client. The plan is that I'll help them refactor a key component in their system and make it more robust and increase performance. Right now they're in the middle of a release and are in 'slip mode'. I find myself feeling some sympathy for Cypher from The Matrix; there I was, safe in my green-tinted world of TDD, then suddenly I find myself in "The real world" and it's nasty and messy and there aren't any tests. Now I wish I could get back to where I was and I don't care if it isn't "real"...


Adding layers without adding value Posted by Len at 6 Mar 2004 11:21 AM
I'm a great fan of wrapping stuff up with thin layers that make the wrapped code easier to use in a given circumstance, or to provide a more appropriate interface. Obviously there are other reasons to wrap APIs but I'm continually amazed at how often the wrapping fails to add much value.


These are not the containers you're looking for Posted by Len at 4 Mar 2004 08:18 PM
STL containers are great. Rather than have to worry about writing doubly linked lists, efficient maps, and other such data structures you just grab one from the STL and you're away. Unfortunately the STL containers have quite a large 'surface area'. Their interfaces are rich because they are generic containers. Often the container you actually need is much more limited in scope and in such situations I always find it's worth wrapping the STL container and providing a more appropriate interface to the user.


Thought for the day Posted by Len at 3 Mar 2004 11:16 PM
If you don't write the code are you doomed to forever be thinking that the abstraction is all in the wrong place? Another day, another dollar. Starting with a new client, well starting back with an old client, and doing...


An abstraction too far Posted by Len at 29 Feb 2004 10:36 PM
Today turned into a day for pondering complexity, abstraction and memory management and watching Pirates of The Caribbean on DVD... I experimented with a version of the buffer allocator that allowed a user defined memory allocation policy. It worked, but it was, I think, unnecessarily complex. If the buffer allocator itself lay behind an interface then that's enough flexibility. Additional abstraction, with an abstract allocation policy in addition to an abstract allocator seemed a tad too abstract... At some point you have to actually make the decision and write the code that does the work. An interesting day's thinking; the film was good too.


More on the bug Posted by Len at 29 Feb 2004 07:12 PM
As I mentioned earlier, I found a memory leak in a piece of code and was lamenting the difficulty in providing automatic tests for such a think when you use new and delete directly. I've thought about this some more and I'm now slightly less concerned...


Does anyone know of a VS.Net 200X to VC 6 project file conversion tool? Posted by Len at 25 Feb 2004 09:05 PM
We have lots of clients who haven't moved away from VC 6 yet. At present we need to maintain all our projects in a VC 6 compilable form. The easiest way to do this is just to use VC 6 as our primary development platform for C++. If we had a tool that allowed us to back port VS.Net 2003 projects to VC 6 then we could maintain the projects in the latest format and back port as required. As it is, we need to maintain them in the earliest format because we know that the newer compilers will always support upgrading from old to new... So, for us, at least, if MS provided a tool that took a project and converted it to an earlier compiler then we'd migrate to the new versions faster... As it is we can only migrate fully when the last of our clients (or potential future clients) gives up on VC 6 ... Is there a 3rd party tool available? We'll pay money... [Updated: the title of the post was wrong ;) I needed a new file format to old file format conversion not an old file format to new file format...]


Why is Outlook 2002's POP handling so slow? Posted by Len at 25 Feb 2004 08:06 PM
I ran Outlook against my POP3 server just now and once again was unimpressed by the speed that messages were being downloaded. It seems that Outlook 2002, over an SSL link to a POP3 server (so no anti-virus weirdness is going on) takes about half a second per message to download a large number of really small messages, from a server on the same machine... Because I'm curious, and because it doesn't appear to be a server issue as the server idles the whole time, I ran up Outlook Express and pointed that at the server (same SSL connection), it flew. Almost 100 x faster (totally unmeasured 'user interface responsiveness')... It was so much faster that I pointed it at a copy of my 'all the mail I've been collecting for test purposes' account which currently contains around 17000 messages... No problem at all, Outlook would still be processing message 100... Most strange... Why's Outlook so crap then?


I hate things that turn off the explorer status bar Posted by Len at 25 Feb 2004 07:33 PM
Whoever decided that it would be a good idea for the explorer status bar to be 'switch offable by someone other than the user' should be taken outside and given a good kicking. Why is it a good to let someone other than the user decide what's the best way to display information? and don't get me started on folder views that reset themselves to the dumb ass icon display for no apparant reason...


Is Open RBL a crock or is my DNS set up wrongly Posted by Len at 19 Feb 2004 05:38 PM
One of the people I email's corporate mailer has started to bounce my mail with the following message: mx.example.com[xxx.xxx.xxx.xxx] said: 554 You have been blocked by a DNS blacklist, please see:- http://www.openrbl.org/ (in reply to MAIL FROM command) So I wander over to www.openrbl.org and type in my domain name and it tells me REJECT: invalid ip-address or non-resolvable hostname: jetbyte.com... Now, it's true that jetbyte.com doesn't have an ip address, but it has a perfectly valid MX record... Shouldn't OpenRBL be checking that the MX record is valid rather than checking that the domain has an ip?


You learn something new every day Posted by Len at 16 Feb 2004 12:53 PM
I'm writing some tests where I need to log calls to function for the test log so that I can make sure the function is called in the expected way when the test runs. The logging version of the object under test derives from the object and adds the logging functionality and calls the object under test to do the work. Of course, for this to work, the functions that I'm interested in can't be private. Some of them were and I was dissatisfied with my current solution (reclassify them as protected because the test needs to access them) and I didn't really want to have the code under test declaring friendship to the logging code from the test library, so I tried a hack, and it didn't work... I decided that I'd be cheeky at the point where I included the headers for the real objects into the logging code. I added #define private protected before the #include and #undef private after the #include. The test compiled, as expected, and then failed to link... It seems that VC 6 mangles the access level into the function signature. I wasn't expecting that. The code under test is defined without my nasty hack and so the functions are private in the library that the test harness links to. The function signature seems to encode that fact so that when I try and link to the library from the test harness that uses the hack the linker can’t find the function because there's no function with the correct signature... I didn't expect that. I'm pleased the compiler does it though; the 'fix' was one of those horrible Monday morning hacks that should never see the light of day.


.Net 1.1 TCP/IP wierdness fixed Posted by Len at 11 Feb 2004 04:16 PM
"Additional information