Endjin - Home

Ian Griffiths's Blog

C# 8.0 nullable references enable us to annotate our code with information that lets the compiler discover possible null-related bugs. The AllowNull attribute lets us get more expressive with properties and generics.

C# 8.0 nullable references enable us to annotate our code with information that lets the compiler discover possible null-related bugs.

C# 8.0’s nullable references feature dramatically changes a fundamental aspect of the language. In this post, Ian explains how to you can soften the impact by enabling gradually across your projects.

C# 8.0 nullable references: inferred (non-)nullness

by Ian Griffiths

C# 8.0 has two related but distinct notions of nullability. In this article, Ian explains why inferred nullness is a vitally important part of the language’s new Nullable References feature.

C# 8.0 nullable references offer benefits besides the obvious win of detecting null-related coding errors. This new language feature can also improve the expressiveness of your code.

C# 8.0 has an ambitious new feature, called nullable references. In this post, Ian explains why this makes a fundamental change to the default assumptions about nullability.

See how to manage consistent default configuration across all your .NET projects by using NuGet build assets.

High-performance C#: a test pattern for ref structs

by Ian Griffiths

C# 7.2 introduce ref structs, a new kind of type (Span is a ref struct) designed to support certain high performance scenarios. There are constraints around their use, and when writing unit tests for our Ais.Net parser, this caused some challenges. This blog describes the technique we used to work around the constraints.

As part of our work with OceanMind, endjin wrote a high performance .NET AIS parser. AIS (Automatic Identification System) is how commercial ships report location information. This blog describes the parser, and the performance techniques it uses.

Why You Should Buy My Book: Programming C# 8.0

by Ian Griffiths

Ian spent a big chunk of last year writing an update to his book, Programming C# 8.0. Books continue to be Ian’s preferred source of learning because nothing else offers the combination of depth, breadth, and coherence. His goal with Programming C# 8.0 (and its predecessors) was very clear: to write the book that he would want to read if he were learning C# today. It is Ian’s attempt to distil around 18 years of experience with C# (part of almost 30 years of work as a programmer) into a coherent, complete description of what you’ll need to know to be productive today in C#.

NDC London Day 1

by Ian Griffiths

In this post, Ian describes some of the highlights from the NDC London conference

AI for Good Hackathon

by Ian Griffiths

Towards the end of last year, Microsoft invited endjin along to a hackathon session they hosted at the IET in London as part of their AI for Good initiative. I’ve been thinking about the event and the broader work Microsoft is doing here a lot lately, because it gets to the heart of what I love about working in this industry: computers can magnify our power to do to good.

C# 8 Positional Patterns Custom Deconstructor Pitfall

by Ian Griffiths

The ‘positional patterns’ added in C# 8 support types with custom desconstructors. However, the way this works might always be quite what you would expect. This article shows a surprising behaviour, and explains how it arises.

C#, Span and async

by Ian Griffiths

The addition of ref struct types, most notably Span, opened C# to a range of high performance scenarios that were impractical to tackle with earlier versions of the language. However, they introduce some challenges. For example, they do not mix very well with async methods. This article shows some techniques for mitigating this.

C# faux amis 3: variable declarations and type patterns

by Ian Griffiths

In this, the final article in a series on the potentially deceptive nature of some new features in C# 8, Ian Griffiths shows how using var can sometimes result in better compile-time type checking than using an explicit type. He reflects on the evolution of C#, and what we can learn from this.

C# v8.0 introduces various new patterns. In this article, part of a series on how the evolution of the language has added complexity, Ian Griffiths shows how the strong resemblance between the new Positional Patterns and Deconstruction can be misleading.

C# faux amis 1: discards and underscores

by Ian Griffiths

Visual Studio 2019 saw the arrival of C# v8.0. This article shows the first of a series of examples of how friction can arise when integrating new features into a mature language: the relatively late addition of ‘discards’ causes some surprises.

C# 8 surprising patterns

by Ian Griffiths

Visual Studio 2019 saw the arrival of C# v8.0. A programming language cannot evolve for 20 years without developing a few quirks. Ian Griffiths writes about a surprising aspect of the new pattern matching features, and what this reveals about how the language has changed.

When he joined endjin, Technical Fellow Ian sat down with founder Howard for a Q&A session. This was originally published on LinkedIn in 5 parts, but is republished here, in full. Ian talks about his path into computing, some highlights of his career, the evolution of the .NET ecosystem, AI, and the software engineering life.

Async pitfalls: deferred work and resource ownership

by Ian Griffiths

Asynchronous code has many traps for the unwary. In fact, it has plenty of ground that’s treacherous even for pathologically careful coders. For example, certain ways of using asynchrony can reduce the control you have over concurrency and ordering. This can result in subtle bugs, particularly when the asynchronous work operates on shared underlying resources. […]