The story of a fiasco. This is the second in a small series of articles titled Trying to fit the hype cycle. In the introduction, I've described the exercise I had in mind: Determining a formula, or at least a piecewise function, for the Gartner hype cycle. This, to be clear, is … | Continue reading
A reading of the third Don Box tenet, with some commentary. This article is part of a series titled The four tenets of SOA revisited. In each of these articles, I'll pull one of Don Box's four tenets of service-oriented architecture (SOA) out of the original MSDN Magazine article … | Continue reading
Another example of using Haskell as an ad-hoc scripting language. This article is part of a short series titled Trying to fit the hype cycle. In the first article, I outlined what it is that I'm trying to do. In this article, I'll describe how I extract a set of x and y coordinat … | Continue reading
An amateur tries his hand at linear modelling. About a year ago, I was contemplating a conference talk I was going to give. Although I later abandoned the idea for other reasons, for a few days I was thinking about using the Gartner hype cycle for an animation. What I had in mind … | Continue reading
A reading of the second Don Box tenet, with some commentary. This article is part of a series titled The four tenets of SOA revisited. In each of these articles, I'll pull one of Don Box's four tenets of service-oriented architecture (SOA) out of the original MSDN Magazine articl … | Continue reading
My inept adventures with a dynamically typed language. This article is the third in a small series about ad-hoc programming in two languages. In the previous article you saw how I originally solved a small data extraction and analysis problem with Haskell, even though it was stro … | Continue reading
A reading of the first Don Box tenet, with some commentary. This article is part of a series titled The four tenets of SOA revisited. In each of these articles, I'll pull one of Don Box's four tenets of service-oriented architecture (SOA) out of the original MSDN Magazin … | Continue reading
Twenty years after. In the January 2004 issue of MSDN Magazine you can find an article by Don Box titled A Guide to Developing and Running Connected Systems with Indigo. Buried within the (now dated) discussion of the technology code-named Indigo (later Windows Communica … | Continue reading
Some thoughts on testing past the happy path. Test-driven development is a great development technique that enables you to get rapid feedback on design and implementation ideas. It enables you to rapidly move towards a working solution. The emphasis on the happy … | Continue reading
Statically typed languages are also good for ad-hoc scripting. This article is part of a short series of articles that compares ad-hoc scripting in Haskell with solving the same problem in Python. The introductory article describes the problem to be solved, so here I'll … | Continue reading
With examples in C#, F#, and Haskell. This article is an instalment in a short series of articles on the Range kata. In the previous three articles you've seen the Range kata implemented in Haskell, in F#, and in C#. The reason I engaged with this kata was that … | Continue reading
Extracting and analysing data in Haskell and Python. I was recently following a course in mathematical analysis and probability for computer scientists. One assignment asked to analyze a small CSV file with data collected in a student survey. The course contained a mix o … | Continue reading
How I currently think about errors in programming. A reader recently asked a question that caused me to reflect on the way I think about errors in software. While my approach to error handling has remained largely the same for years, I don't think I've described it in an … | Continue reading
A port of the corresponding F# code. This article is an instalment in a short series of articles on the Range kata. In the previous article I made a pass at the kata in F#, using property-based testing with Hedgehog to generate test data. In the conclusion I mus … | Continue reading
This time with some property-based testing. This article is an instalment in a short series of articles on the Range kata. In the previous article I described my first attempt at the kata, and also complained that I had to think of test cases myself. When I find it tedio … | Continue reading
A first crack at the exercise. This article is an instalment in a short series of articles on the Range kata. Here I describe my first attempt at the exercise. As I usually advise people on doing katas, the first time you try your hand at a kata, use the language with wh … | Continue reading
In the languages I usually employ. The Range kata is succinct, bordering on the spartan in both description and requirements. To be honest, it's hardly the most inspiring kata available, and yet it may help showcase a few interesting points about software design in gener … | Continue reading
Using System.Text.Json, with and without Reflection. This article is part of a short series of articles about serialization with and without Reflection. In this instalment I'll explore some options for serializing JSON with C# using the API built into .NET: System.Text.J … | Continue reading
Using System.Text.Json, with and without Reflection. This article is part of a short series of articles about serialization with and without Reflection. In this instalment I'll explore some options for serializing JSON with F# using the API built into .NET: System.Text.J … | Continue reading
Using Aeason, with and without generics. This article is part of a short series of articles about serialization with and without Reflection. In this instalment I'll explore some options for serializing JSON using Aeson. The source code is available on GitHub. … | Continue reading
An investigation of alternatives. I recently wrote a tweet that caused more responses than usual: "A decade ago, I used .NET Reflection so often that I know most the the API by heart. "Since then, I've learned better ways to solve my problem … | Continue reading
Or, rather: Try not to. A few months ago I visited a customer and as the day was winding down we got to talk more informally. One of the architects mentioned, in an almost off-hand manner, "we've embarked on a SAFe journey..." "Yes..?" I responded, hoping that m … | Continue reading
A refactoring example. When I introduce the Fake Object testing pattern to people, a common concern is the maintenance burden of it. The point of the pattern is that you write some 'working' code only for test purposes. At a glance, it seems as though it'd be more work t … | Continue reading
Noun. Game in which the goal is to minimise cyclomatic complexity. Cyclomatic complexity (CC) is a rare code metric since it can be actually useful. In general, it's a good idea to minimise it as much as possible. In short, CC measures looping and branching in c … | Continue reading
Contracts of Fake Objects can be described by properties. The first time I tried my hand with the CQRS Booking kata, I abandoned it after 45 minutes because I found that I had little to learn from it. After all, I've already done umpteen variations of (restaurant) bookin … | Continue reading
A raw port of the previous F# demo code. This article is part of a short article series on applicative validation with a twist. The twist is that validation, when it fails, should return not only a list of error messages; it should also retain that part of the input that … | Continue reading
Persistence concerns second. A few weeks ago, I published an article with the title Do ORMs reduce the need for mapping? Not surprisingly, this elicited more than one reaction. In this article, I'll respond to a particular kind of reaction. First, however, I'd l … | Continue reading
Static types are useful, but have limitations. Regular readers of this blog may have noticed that I like static type systems. Not the kind of static types offered by C, which strikes me as mostly being able to distinguish between way too many types of integers and pointe … | Continue reading
Ultimately, it's more about programming than food. The Sandwich was named after John Montagu, 4th Earl of Sandwich because of his fondness for this kind of food. As popular story has it, he found it practical because it enabled him to eat without greasing the cards he of … | Continue reading
AKA Framework Whac-A-Mole, Library Whac-A-Mole. I have now three times used the name Whac-A-Mole about a particular kind of relationship that may evolve with some dependencies. According to the rule of three, I can now extract the explanation to a separate article. This … | Continue reading
A ploeh mystery. I was recently playing around with the example code from my book Code That Fits in Your Head, refactoring the Table class to use a predicative NaturalNumber wrapper to represent a table's seating capacity. Originally, the Table constructor and c … | Continue reading
With some Entity Framework examples in C#. In a recent comment, a reader asked me to expand on my position on object-relational mappers (ORMs), which is that I'm not a fan: I consider ORMs a waste of time: they create more problems than they solve. … | Continue reading
An experience report. In my book Code That Fits in Your Head (CTFiYH) I write in the last chapter: If you've looked at the book's sample code base, you may have noticed that it looks disconcertingly monolithic. If you consider the full code base that inclu … | Continue reading
Test-driven development in C#. A customer hired me to swing by to demonstrate test-driven development and tactical Git. To make things interesting, we agreed that they'd give me a kata at the beginning of the session. I didn't know which problem they'd give me, so I thou … | Continue reading
With simple and easy-to-understand examples in F# and Haskell. Eve Ragins recently published an article called Why you should use truth tables in your job. It's a good article. You should read it. In it, she outlines how creating a Truth Table can help you smoke … | Continue reading
A simple C# example. A reader recently wrote me about my 2013 article Mocks for Commands, Stubs for Queries, commenting that the 'final' code looks suspect. Since it looks like the following, that's hardly an overstatement. public User GetUser(int userId) { … | Continue reading
The universal API for generic non-empty collections, with examples in C# and Haskell. This article is part of an article series about catamorphisms. A catamorphism is a universal abstraction that describes how to digest a data structure into a potentially more compact va … | Continue reading
Some thoughts on TDD related to integration and systems testing. My recent article Works on most machines elicited some responses. Upon reflection, it seems that most of the responses relate to the top of the Test Pyramid. While I don't have an one-shot solution … | Continue reading
A rant, with some examples. I've been a software user for thirty years. My first PC was DOS-based. In my first job, I used OS/2, in the next, Windows 3.11, NT, and later incarnations of Windows. I wrote my first web sites in Arachnophilia, and my first … | Continue reading
TDD encourages deployment flexibility. Functional programming also helps. Recently several of the podcasts I subscribe to have had episodes about various container technologies, of which Kubernetes dominates. I tune out of such content, since it has nothing to do with me … | Continue reading
A solution in search of a problem? I was recently listening to a podcast episode where the guest (among other things) enthused about how advances in large language models mean that you can now get these systems to write XML doc comments. You know, these things: … | Continue reading
On separating preconditions from business rules. My recent article Validation and business rules elicited this question: "Regarding validation should be pure function, lets have user registration as an example, is checking the email address uniqueness a va … | Continue reading
A definition of validation as distinguished from business rules. This article suggests a definition of validation in software development. A definition, not the definition. It presents how I currently distinguish between validation and business rules. I find the distinct … | Continue reading
On the tension between encapsulation and testability. This article is part of a series called Epistemology of interaction testing. A previous article in the series elicited this question: "following your suggestion, aren’t we testing implementation details … | Continue reading
Mostly in C#, with a few lines of Haskell code. A recent article elicited more comments than usual, and I've been so unusually buried in work that only now do I have a little time to respond to some of them. In one comment Struan Judd offers a refactored version of my Co … | Continue reading
A pair of simple operations resurrected it. The other day I had an 'interesting' experience. I was about to create a small pull request, so I checked out a new branch in Git and switched to my editor in order to start coding when the battery on my laptop died. C … | Continue reading
How code files are organised is hardly related to sustainability of code bases. My recent article Folders versus namespaces prompted some reactions. A few kind people shared how they organise code bases, both on Twitter and in the comments. Most reactions, however, carry … | Continue reading
Yes, it involves JSON and regular expressions. Ever since I migrated the blog off dasBlog I've been writing the articles in raw HTML. The reason is mostly a historical artefact: Originally, I used Windows Live Writer, but Jekyll had no support for that, and since I'd bee … | Continue reading