Archive - 2009
December 24th
Code Complete: Working Classes (Part 2 - Good Class Interfaces)
This post represents the second instalment taken from chapter 6 of Code Complete, entitled "Working Classes". This post covers the issues to consider when designing class interfaces, illustrated with code samples. An important piece of information to keep in mind when reading this post is that McConnell is talking in terms of the public interface exposed by a class through its public members. While an interface (as defined in Java or C#) also fits this bill, some of the advice given here is specific to the idea of a class interface, and not a standalone interface.
If you're after the executive summary (this is quite a long post, after all), there are only two things you must build into your class interfaces: good abstraction and good encapsulation. Read on to find out more.
Code Complete: Working Classes (Part 1 - Class Foundations: Abstract Data Types)
Another day, another Code Complete blog post. I might even clear two today, looking at the number of notes I have for this one.
The last post rounded off the contribution to the discussion around the problems of designing software. A new chapter means a new topic, and chapter 6, titled "Working Classes", deals with tips on, and the issues around, creating classes in your program. First up is the topic of Abstract Data Types: what they are, why you should be interested, and how you should use them.
December 23rd
Code Complete: Design in Construction (Part 4 - Design Practices)
Wow, it's been quite a while since I updated my Code Complete series, and I've got quite the backlog to wade through now! Looking at the last save date on this post, it's been sat around for three months waiting to be written, so I'm sorry for being so slack, and I'll get on with writing it now...
This post covers some key design practices, and is the last post on Chapter 5, Design in Construction.
November 26th
An Education





This moving story of a teenager growing up in 1960s London charms, startles, amuses, shakes and delights in equal measure.
An Education: L-R Dominic Cooper, Rosamund Pike, Peter Saarsgard, Carey Mulligan
- Add new comment
- Read more
- 513 reads
- 1 trackback
November 22nd
NMock 2 vs Moq
You may remember from my previous blog post on mocking frameworks that I'm a bit of a fan of this kind of tool. They're great for simplifying unit testing, and can also help guide you in to writing better, more loosely-coupled code via Dependency Injection.
Last night I spent some time porting some of my unit tests for a side project I'm working on from NMock 2 to Moq 4 (currently in beta). My reasons for switching were three-fold: first, NMock can only mock interfaces which was causing problems with testing some parts of my code that relied on elements of the ASP.NET MVC framework; second, NMock is unable to support some of the newer features of .NET as it was written to target .NET 2.0 (whilst each version of Moq is matched to the respective version of .NET, so the Moq 4 beta can utilise the C# 4.0 goodies like dynamic typing); last, the NMock project doesn't seem to be as active as it once was, with the last official build released in January 2008.
As a result of this switch, I'm in more of a position to critically evaluate NMock and Moq than I was when I wrote my original post. Here's a summary of my thoughts and experiences.
November 8th
Stack Overflow Dev Days - London
On Wednesday 28 October 2009, Joel Spolsky and Jeff Atwood brought their Stack Overflow sideshow to London's Kensington Town Hall, and I was lucky enough to be one of the ~1000 people attending.
November 4th
Visual Studio Build Progress in the Windows 7 Task Bar: Creating a Small VS 2010 AddIn
Windows 7 introduces a whole bunch of cool features, as I've mentioned here previously. Sometimes the simplest ones are the most effective, however, and there's nothing simpler or more effective than the in-taskbar progress indicator. If you haven't seen this already, when you copy a file in Windows Explorer, download a file using IE, or perform any of a number of similar actions that might take a while to complete, the progress information is displayed in the task bar icon for that application.
Windows 7 Taskbar Progress: This screenshot also illustrates the "Icon and Text" display mode
- Add new comment
- Read more
- 4672 reads
September 20th
O (2001)





Over the last couple of weeks, I've found myself watching a couple of Shakespeare re-tellings, including Baz Luhrmann's rather excellent 1996 version of Romeo and Juliet. O doesn't quite measure up to Luhrmann's visionary re-telling of star-crossed lovers, but in many respects it's rather unfair to compare the two as they deal with their source material in very different ways: Luhrmann and Craig Pearce update the surroundings, dress and props for the late twentieth century, but leave the dialogue in Shakespearean English; in O, Brad Kaaya provides a fresh environment for the tale of Othello in his screenplay.
- Add new comment
- Read more
- 465 reads
September 6th
Small update
That busy period at work that I mentioned hasn't really ended, and by the sounds of things it won't be any time soon. As such, it's likely that my Code Complete series is going to be put on hold for a while longer as we ride this current and move on.
- Add new comment
- Read more
- 483 reads
July 25th
Code Complete: Design in Construction (Part 3 - Design Building Blocks: Heuristics)
Ok, so this is my first post on Code Complete for a little while; it turned out the busy period at work lasted a good couple of weeks longer than I thought it would! It was a quite a while back that I made these notes (mid-June, in fact), so if the post seems less coherent or I've got something obviously wrong, please leave a comment. Here be dragons.
This post deals with design heuristics. We've already touched on what heuristics are in the Software Development Metaphors post, so you might want to refresh your understanding before reading on. Inside, I will cover McConnell's description and critical evaluation of the most common design heuristics. These can be viewed as smaller steps in a larger process, or as individual methods to use at different stages of the design process.
Note: this is a long post!
Chocolate Heuristics: Copyright © 2006 maadmob

![O [DVD] [2000] Image of O [DVD] [2000]](http://ecx.images-amazon.com/images/I/51AKQNMA29L._SL75_.jpg)