I was wrong regarding the private keyword. Here’s why

Sometime ago, I wrote what turned out to be a highly controversial post in which I argued that private members should be avoided as they caused more problems than they solved. Two years on, I have come to realise that I was wrong and that problems with private members are simply symptoms of bad written code, rather than problems in their own right. Continue reading “I was wrong regarding the private keyword. Here’s why”

Improving NUnit custom constraints with syntax helpers

NUnit’s custom constraints support is a powerful feature for improving the quality and clarity of tests involving objects with complex state, yet – by themselves – the syntax is messy and difficult to read. However, a simple trick of using static methods can greatly enhance the readability of these constraints. Continue reading “Improving NUnit custom constraints with syntax helpers”

Using custom constraints to improve NUnit test quality, part 2 of 2

Writing good quality unit tests for your code can be hard. Neither multiple asserts in one test, nor multiple single-assert tests are ideal solutions. There are alternatives though, which this article explores. It culminates in a description of a powerful way of writing tests using NUnit.
Continue reading “Using custom constraints to improve NUnit test quality, part 2 of 2”

Using custom constraints to improve NUnit test quality, part 1 of 2

Writing unit tests for your code is a laudable thing to do. Most developers who have tried using a test-orientated approach to development will agree that it is a superior approach to development, compared with not writing them. However, writing good tests can be hard. This two-part article explores the arguments for multiple asserts verses multiple single-assert tests and – having explained why neither is ideal – examines a powerful alternative that solves the problems with both approaches.
Continue reading “Using custom constraints to improve NUnit test quality, part 1 of 2”

Windows 8 and Surface: Microsoft’s do or die moment?

Microsoft SurfaceRecently I haven’t been blogging much as my career took a sudden change of direction and I found myself having to re-learn C# and .NET skills I’d not used for five years, as well as having to catch up with the changes to those technologies in that time. Whilst I like C# as a language, I have been feeling a sense of trepidation over finding myself using such technologies, for I couldn’t see how Microsoft could escape heading down Nokia’s path from dominance to oblivion. The announcement of the Microsoft Surface may have just changed that, but I’m not completely convinced.

Continue reading “Windows 8 and Surface: Microsoft’s do or die moment?”

Is Apple becoming a purveyor of bling?

Apple, a name – quite rightly – associated with high quality, beautifully crafted technology. From the iPhone to OS X, from the iPad to the much-aped MacBook AIR, their products are built on sound design principles giving them a clean, simple, yet powerful look and feel. Or so it used to be at least, for recent software developments smell very much of Apple losing it.

Continue reading “Is Apple becoming a purveyor of bling?”