Marius Schulz

Combining Modifiers in C#: "protected internal" and "override sealed"

C# defines plenty of modifiers for type and type member declarations, some of which can be combined. Learn about how "protected internal" and "override sealed" work.  more →

Stop Cheating the Type System

In C#, every variable of a reference type can hold a null value. Some types like collections and delegates, however, allow for much better default values. Reduce your bug surface area by following reasonable conventions when dealing with null.  more →

Fun with Custom C# Collection Initializers

The collection initializer syntax of C# is a clean way to initialize a collection with values. The compiler will insert appropriate method calls which actually add those items. We can leverage the convention-based nature of this process to provide our custom collection initializers.  more →

A Little HtmlHelper for Implementing Adaptive HTML Images in ASP.NET MVC

As part of HTML5, the srcset attribute for img tags has been specified by W3C to provide an HTML extension for adaptive images. Because responsive images are a feature we all should start using today, I want to show you my approach for emitting adaptive `img` tags in ASP.NET MVC.  more →

Why Using the Greedy .* in Regular Expressions Is Almost Never What You Actually Want

Oftentimes, using .* in a regular expression doesn't yield the results you want. Read about how overly greedy quantifiers account for poor performance and even lead to incorrect matches.  more →

Marius Schulz on Twitter Marius Schulz on GitHub RSS Feed