Category Archives: Pragmatism

Why I Write Automated Tests For My Code

I started my journey of unit testing my code about 4 years ago… I had played with nunit prior to that, but I never understood the point and would delete my tests after I got them to pass… that was … Continue reading 

Also posted in Agile, Behavior Driven Development, Craftsmanship, Quality, Unit Testing | 3 Comments

Red/Green/Refactor, For The Right Reasons

First, let me say this: WHAAaa???? something useful occurred on Google Buzz?! :) Ok, now that I’ve got that over with… there was a useful stream of comments over on the extended twitter reply network from one of my tweets … Continue reading 

Also posted in Agile, Analysis and Design, AntiPatterns, Principles and Patterns, Refactoring, Unit Testing | 11 Comments

A Type Safe IDataReader Wrapper

I don’t always use NHibernate… it’s true… in fact, plain old ADO.NET, DataSets, DataTables and IDataReaders can offer some nice advantages when used in the right way at the right time. Today, I found myself writing more IDataReader code and … Continue reading 

Also posted in .NET, C#, Data Access, Design Patterns | 8 Comments

CQRS Performance Engineering: Read vs Read/Write Models

I’ve used a lot of different architectures, patterns and implementations that revolve around the core concept of command-query separation (CQS) and the more recent label of command-query responsibility separation (CQRS). The ideas behind these principles help us create code that … Continue reading 

Also posted in Analysis and Design, CQRS, Principles and Patterns | 6 Comments

Don’t Expose IList<T> Just So You Can Assert Against Its Contents

Lately I’ve been trying to return IEnumerable<T> whenever I need a collection that will only be enumerated or databound to something. This prevents me from making changes to the collection outside the context of the collection’s parent entity. The problem … Continue reading 

Also posted in .NET, C#, Principles and Patterns, Unit Testing | 17 Comments

How Ruby Taught Me To DRY Up My Code With Lambda Blocks

I’ve been working in Ruby for my Albacore project over the last 6 or 8 months, and taking every chance I can find to learn how to really use the language effectively. One of the benefits I’m seeing in a … Continue reading 

Also posted in .NET, C#, Lambda Expressions, Model-View-Presenter, Principles and Patterns, Ruby | 5 Comments

When Do You Specify Expected Parameters In Stub Methods?

I’m writing a spec with a mock object that mock object returns data to the class under test. In these situations, I don’t bother asserting that my mock object’s method was called because I know that if it’s not called … Continue reading 

Also posted in .NET, Behavior Driven Development, C#, Principles and Patterns, Unit Testing | 16 Comments

Field Vs. Property: Does It Really Matter?

Given my recent experiences with Ruby, my cursory knowledge of Java, and my past experiences with other object oriented systems, I find myself asking a lot of questions about why we do things the way we do in the C#/.NET … Continue reading 

Also posted in .NET, Principles and Patterns, Ruby | 25 Comments