danielwertheim

danielwertheim


notes from a passionate developer

Tags


Disclaimer

This is a personal blog. The opinions expressed here represent my own and not those of my employer, nor current or previous. All content is published "as is", without warranty of any kind and I don't take any responsibility and can't be liable for any claims, damages or other liabilities that might be caused by the content.

Some ways to tame magical strings in .NET and C#

We have all seen them. The strings lying around here and there in the code base. Some times at least exposed as constants in the class. But what else can you do? Well, you can have things like dedicated constant classes or key masters or value-objects or just allow the user to easily pick a value using a simple Func<,>. Before looki…

Daniel WertheimDaniel Wertheim

Generic method cache vs reflection

Today, I was looking around in the source code of a project on GitHub and noticed some reflection used to extract methods. The methods in turn were used to apply state to instances during aggregations and projectins. I found out that the access path to the code only were once per aggregate/projection type and that the reflected methods in…

Daniel WertheimDaniel Wertheim

Do I need to use ConfigureAwait(false) all the way?

Using ConfigureAwait(false) is said to be a recommendation for e.g. third party library authors. Why? Well, lets say you are building a ASP.Net API hosted via IIS and consume a library that offers an async API for e.g. I/O bound work. When using it you "manage" to introduce a blocking call via e.g. Task.Result higher up the call stack and…

Daniel WertheimDaniel Wertheim

Visualising my heart rate on stage using a Hue lamp and a heart rate sensor and .NET

This week I held a talk at Swetugg, a two day Swedish conference for .NET developers. My title was: "NATS, what a beautiful message protocol!". In order to show a good use-case of NATS I put together a small demo where I read my heart rate in real time using a sensor and ANT+ SDK, which was published via NATS. I then had two different ser…

Daniel WertheimDaniel Wertheim