A favorite C# pattern

23 April 2023

Nulls and Exceptions, a horrific yet most popular combination in C#:

public CookieValueProvider(HttpActionContext actionContext)
{
    if (actionContext == null)
    {
        throw new ArgumentNullException("actionContext");
    }

    // [...] Remaining code removed for clarity.
}
Spread the Word