Hey, I'm Steven a .NET Developer in Switzerland. I am a Microsoft MVP. Also, this blog is open source on GitHub.

Older Posts

Preview image blogpost

ILGPU - Processing Data on your GPU (CUDA / OpenCL in C#)

If you ever needed a massive amount of data processed in parallel you might had a look at OpenCL or CUDA. Both are based on a subset of C to describe the program your GPU has to execute.

So let's have a look how we can achieve this in the .NET way. Furthermore I'll give you some insights about GPGPU (General-purpose computing on graphics processing units) in general. Also some limitations and big differences to conventional "CPU"-Programming.

Read the whole article

Preview image blogpost

static abstract interfaces and generic math

Besides the big announcements of .NET 6 there are also some smaller features. I want to show case a special one: static abstract interfaces. With this you have ability to extend the contract in that sense, that an implementing class has to provide also static methods. This feature is right now flagged as preview, but you can use it if you want.

This also enables generic math operations on an interface level.

Read the whole article

Preview image blogpost

A better enumeration - Type safe from start to end

Enumerations are one of the fundamental value types in C#. enum's are handy if you have a constrained set of allowed values. But the enum type also has a lot of drawbacks. Personally, one major issue for me is that you can't define methods inside the enum. Plus, you can just pass them invalid values and it just works (Todd Howard I'm looking at you).

So why not make a lightweight alternative which removes a lot of the shortcomings of an enum?

Read the whole article

Preview image blogpost

git hook - prefix your commit message with your JIRA ticket

In this short blog post I'll show you how you can automatically prefix your commit messages with the JIRA ticket derived from your branch name.

Read the whole article

Preview image blogpost

API Versioning in ASP.NET Core made easy

How can we have versioning with a public facing REST API in ASP.NET Core? This blog post will show you the foundation how to setup and configure versioning. Furthermore I will give you some ideas how to structure your code and what kinds of versioning you can do.

In the end you should be able to have the same endpoints with multiple versions.

Read the whole article

Preview image blogpost
  • 9/10/2021
  • 19 minute read

git - useful aliases

In this article I'll show you some of my most used git aliases which make my everyday work easier and more productive.

Read the whole article

Preview image blogpost

IEnumerable vs IQueryable - What's the difference

.NET brings two types which seem very similiar

  • IEnumerable
  • IQueryable

What is the difference? Most are familiar with using IQueryable when we want to go to the database and back. But why not using IEnumerable?

Read the whole article

Preview image blogpost

How to hunt down bugs with git bisect

This article will show how you can identify the commit a bug was introduced.

Sometimes it is hard to track down a bug. Your only chance is to exploratory test your code until you find the code in question. I will show you a way how to do this with git. More specific how to use git bisect

Read the whole article

Preview image blogpost

How to rebase onto a different branch with git

We're all been there. You worked on a feature or bug on your branch and after some commits you noticed "Oops, I should have branched from xyz instead of abc". I'll show you an easy way of simply moving your stuff from branch abc to xyz.

Read the whole article

Tactical Design Patterns in C# - Part 1: Creational

This guide will give an overview of common design patterns in C#. We'll also have a look what is there advantage and how can we implement them. Let's start with creational design patterns.

Read the whole article

An error has occurred. This application may no longer respond until reloaded. Reload x