Complex Object Graphs, Side Effects, and the Record Pattern

I hope you and your loved ones are doing as well as can be expected in these difficult times. I feel very fortunate to be gainfully employed during the Coronavirus pandemic. Introduction I ran into an interesting coding issue at work I’d like to discuss here. It involves a subtle object reference inequality bug in my implementation of the Record Pattern. At least that’s what we call the pattern at work. To discuss the issue here I’ll change the names of classes to avoid revealing any intellectual property and simplify the code to the minimum necessary to demonstrate the issue […]

Hello World, Poker Style

I have updated my reference application with code that evaluates Texas Hold ‘Em poker hands. I had written the poker logic a few months ago. Recently, I moved it into a class library and service. This project is a long way from a functioning poker application that enables users to play Texas Hold ‘Em against artificial intelligence “bots”- my ultimate goal. But it’s a fun start. Evaluating poker hands certainly is more entertaining than confirming a “Hello World” message sent through an SOA stack appears at the other end of the pipe- on a web page in the user’s browser. […]

The Best Domain-Specific Language for Manipulating Data is SQL

Motivation I’m not a fan of Microsoft’s Language Integrated Query (LINQ). But ranting about a language feature is an ineffective way to convince programmers of the merits of other techniques. So decided to construct a detailed example that illustrates how LINQ solves a certain problem, contrast it with a different technique, then highlight the deficiencies of LINQ and extol the virtues of my preferred technique. I happily set about creating a relational database and C# object model, then hit an impasse. When the time came to determine how to write LINQ code that maps the relational data into the C# […]