Rob West

Patterns and Practices

Development Is Complex, Not Complicated

Understanding the difference in meaning between complex and complicated puts you in the right mindset to succeed in your development practice. The difference is significant, and failure to understand it is at the heart of many unsuccessful projects. I have found that staying "complexity conscious" has helped guide my decision making and avoids an over reliance on rules and bureaucracy.

Using Fragments For Components With Gatsby And Kontent

The use of GraphQL in Gatsby brings many advantages, but it can lead to duplication of query fields across pages and templates. This is a quick guide on a pattern for using fragments inside your React components to avoid duplication.

Constrained Open Generics and Dependency Injection

Jimmy Bogard, author of those stalwart NuGet packages Automapper and MediatR, recently blogged about an upcoming change that he championed in the behaviour of the .NET Core Dependency Injection container. The change related to constrained open generics, a pattern that I had not even considered, which opens up some interesting possibilities.

Goldilocks abstraction for maintainable code

Keeping code DRY is a good thing, but doing so with clever abstractions can result in complexity that reduces clarity, making the code harder to maintain. I think there is a Goldilocks zone for abstraction, just enough to avoid code duplication, but not so much as to create overly complex code that is hard to understand and reason about.

C# Tuples as Syntactic Sugar for Multiple Variable Assignment

I came across an interesting pattern for using Tuples in an article by Mads Torgersen on C# 9.0. At first I thought it must be something new in 9.0, but a little digging and actually engaging my brain made me realise it has been possible since C# 7.0 and the introduction of Tuples. It isn't something I've seen anybody else use so I thought it would be worth writing about.

Command Query Separation with ASP.NET MVC

I have been struggling for some time to find an application architecture for ASP.NET MVC that both respects SOLID principles and is also quick and simple to use. Is the command query pattern the answer?

© 2022 Rob West. All Rights Reserved. Built using Kontent and Gatsby.