Author Archives: simon

Unit testing code that uses a BackgroundWorker

The BackgroundWorker class is a fantastically simple way of firing off long-running tasks without the complexities associated with threading. However, tests that exercise code that uses a BackgroundWorker may not behave as desired. Unit tests run synchronously, and will not … Continue reading

Posted in Uncategorized | Comments Off on Unit testing code that uses a BackgroundWorker

Don’t Swallow Exceptions – Ever

Is there any good reason to do this? I say no. It makes your code run slower, and with tricky to debug errors. Throw exceptions early – then they will be dealt with during development, rather than in production. We … Continue reading

Posted in Uncategorized | Comments Off on Don’t Swallow Exceptions – Ever

Windows Forms Presentation Model Implementation

As mentioned last time, the Presentation Model pattern allows us to decouple our UI Model from our domain model. Briefly restated, this is a good thing, as we do not want UI concerns to leak into our domain model, and … Continue reading

Posted in UI, Windows Forms | Tagged , , | Comments Off on Windows Forms Presentation Model Implementation

Logging is good, mmmmkay

Actually, it’s more than good, logging is essential in any application. We wasted a whole load of time today because we weren’t using our standard logging framework (log4net), and the basic logging that was implemented was throwing an error that … Continue reading

Posted in debugging, testing | Tagged , , , | Comments Off on Logging is good, mmmmkay

Formatting code in WordPress

OK, so it is my second post, and things are going downhill already. Meta-Blogging. The first rule of blogging is no meta-blogging. Someone might find this useful though. I just figured out how to get nice code formatting with little … Continue reading

Posted in Uncategorized | Comments Off on Formatting code in WordPress

Presentation Model in Windows Forms

So, certain UI patterns are getting a fair bit of coverage in the .net community currently. Jeremy Miller and Glenn Block for instance, have been posting about this pattern in the past week or so. My current project has Windows … Continue reading

Posted in UI, Windows Forms | Tagged , , , , | Comments Off on Presentation Model in Windows Forms