One thing I run into a lot when reviewing C# code that uses LINQ is that we developers tend to gravitate towards using First() rather than Single(), even though that’s almost never what we actually want. Both operate on a collection and return one element from it. Both throw if no element is found. If […]
Property abuse in C# is a pet peeve of mine. Properties are meant to represent data, and methods are meant to represent actions. When properties are used improperly, you create a breeding ground for misunderstandings and bugs. Take a look at MSDN’s guidelines on when to use a method instead of a property. See any […]
Apparently, it’s not uncommon for business to create some tables in an Access database, pass it around to anyone who needs it, and basically treat it like a big Excel spreadsheet. Not uncommon, I think, because in the last year I’ve been tasked with importing 4 different Access databases from 2 different clients into a […]
I like the idea of TDD, but some of the articles and blog posts I’ve read about it feel a little too much like they’re saying “Don’t question our cult! Do what I say!” to me. When proponents of TDD push the “You absolutely have to do it this way or you’re doing it wrong!” […]