Covariance and contravariance – part 1: Arrays and lists

This post is the first in a series - for once I will split a large topic into a few small posts. The series is about covariance and contravariance, together known as variance. Arrays and listsContravariance in interfacesCovariance in interfaces Covariance and contravariance are terms I came across occasionally, and never understood properly. Having put … Continue reading Covariance and contravariance – part 1: Arrays and lists

Performance optimisation – for machines or people?

I recently watched a video and listened to a podcast that form an interesting pair of opinions about performance.  The video is Patterns for high-performance C# and the podcast is SE-Radio Episode 357: Adam Barr on Software Quality. There are two things where the podcast and video have no differences: the system must behave correctly, … Continue reading Performance optimisation – for machines or people?

Named parameters with default values can help unit tests

Introduction I find myself using default values much more in unit tests than in production code.  That is, I do it more often, and use more parameters with defaults per method.  This isn't because default values are bad, but they are often particularly useful when setting data up for unit tests.  It makes the tests … Continue reading Named parameters with default values can help unit tests