Kafka / Docker Tips

This page just contains some useful Kafka and Docker information I refer to from time to time. Kafka Tips How to get a list of Kafka topics? How to get info on a Kafka topic? How to create a Kafka topic? How do I get a list of the Kafka bin folder? How do I […]

Reverse Double Linked List in C#

This is a question that often comes up in an interview. The solution is simple. To begin with, initialise three node references: current points to the head node previous points to null next points to null Remember to point the tail to the head before we begin: tail = head; Now, iterate over the nodes […]

XMPP Progress

The XMPP Component framework is coming on nicely. It can connect and send/receive messages: Using C# again is a joy. I absolutely love the dynamic capabilities. For example, in this factory method, Ping is dynamically added – it is not a property: Which produces the following XML: Eventually Ping will be its own subpacket, but […]

C# Null! Tip

C# 8.0 introduced non-nullable reference types. Sometimes, however, you want to late initialize a field, like in Kotlin: You can do this in C# using null! Usefulness C# non-nullable references are very useful, but you still need to be disciplined, code defensively, and make good use of guard classes. Null exceptions are not that hard […]

Enums and Literals

One of the things I love about C# is reflection. Because of assemblies and metadata, and an excellent supporting framework, it is very easy to take advantage of this paradigm. This week I threw myself into building an XMPP component framework from scratch. The first objective is to get the plumbing and architecture in place. […]

Concise C# Property Name

When constructing XML elements, it’s nice to have a concise API. One of the features I’m implementing is the ability to easily move up to a parent element. There’s no cascade operator in C#, like you see in Dart. Whilst exploring options, I found this works: Example usage: I thought that was interesting – albeit […]

Result or no Result

Recently I spent a couple of hours building a few classes to support some functional programming constructs in C#. At the end of the experiment, doubts have me backing out mostly. In certain use cases, the new constructs are a nice fit, but they can easily be overused. And their usage has a cascading effect […]


One thing I love about using C# is reflection, it adds another paradigm to the toolkit. Recently, I revisited my old friend Activator.CreateInstance which is perfect for scenarios where you want to use generic code to create and initialize specific types of objects. Basic Example Some time ago, I wrote a simple application which plugs […]

Troubleshooting WCF Performance

This is a re-post from 2011 for reference purposes. A small configuration setting can make a big difference. I’m currently working on a C# test application which dispatches real units of work through an Oracle Service Bus (OSB) to C++ services on an AIX box. The application uses the Supervisor Pattern where a single dispatcher, […]

NDepend – A Developer’s Best Friend

Creating a Mess Recently I began work on an XMPP Component Framework in C#, initially trying to reuse code from a previous version. I’m trying to do it right this time, conforming to the official specifications. This has led to a lot of rework as the previous version was essentially based upon code I’d written […]