Endjin - Home

Ian Griffiths's Blog

C# 8 Positional Patterns Custom Deconstructor Pitfall

by Ian Griffiths

C# 8 adds a wide array of new pattern types to the pattern matching features introduced in C# 7. One of these is the ‘positional pattern’. This is a recursive pattern, meaning that it contains nested patterns. It can be used to determine whether tuples match certain criteria. For example: All the case labels here […]


C#, Span and async

by Ian Griffiths

C# 7.2 introduced support for ref struct types. These are types that are required to live on the stack. The most notable ref struct types are Span<T> and ReadOnlySpan<T> which have made it possible to dramatically improve the efficiency of certain kinds of work by reducing or even eliminating object allocations. Endjin recently open sourced […]


C# faux amis 3: variable declarations and type patterns

by Ian Griffiths

This is the final article in my series on faux amis in C#. At last, I will delve into the strange discovery that kicked this all off. C# 8 and faux amis: Introduction C# faux amis 1: discards and underscores C# faux amis 2: tuple deconstruction and positional patterns C# faux amis 3: variable declarations […]


This is part of a series of articles about faux amis in programming languages—constructs that can fool us through a misleading resemblance to one another: C# 8 surprising patterns (Introduction) C# faux amis 1: discards and underscores C# faux amis 2: tuple deconstruction and positional patterns (you are here) C# faux amis 3: variable declarations […]


C# faux amis 1: discards and underscores

by Ian Griffiths

This is the second in a series of articles: C# 8 surprising patterns (Introduction) C# faux amis 1: discards and underscores (you are here) C# faux amis 2: tuple deconstruction and positional patterns C# faux amis 3: variable declarations and type patterns In the introduction, I described the idea of faux amis in spoken languages […]


C# 8 surprising patterns

by Ian Griffiths

Recently, I made a surprising discovery. I had downloaded a preview of Visual Studio 2019 and was experimenting with some of the new language features in C# 8, when I discovered something: Switching between var and int can sometimes move type checks from compile-time to runtime. This shocked me. The experimental evidence (which I’ll get […]


In September I joined endjin a Technical Fellow (an entirely new branch in endjin’s career pathway to accommodate me – more on that later). I’ve has been involved with endjin since 2011, as an Associate, helping to deliver some of our most technically challenging projects (and if you go even further back, I attended Cambridge University with endjin co-founder […]


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. […]


Joining endjin as a Technical Fellow

by Ian Griffiths

I am very excited to announce that after 21 years as a freelance consultant, I am finally settling down: this month, I am joining endjin as a full time employee. I’ve been an endjin associate for over 7 years now, so this isn’t a huge leap, but our trajectories have aligned in such a way […]