If you're using enum.ToString() that often, you're doing it wrong

Daniel Wertheim measured the performance of enum.ToString and found it to be 400x slower than using a comparable class with const’s. That’s a »

ASP.NET vNext Dependency Injection with Castle Windsor

In a previous post I explained how to set up and use the built in dependency injection container in ASP.NET vNext. Today we’re going »

Microsoft releases a preview of the .NET Compiler Platform, codenamed Roslyn

Microsoft released a public preview of the .NET Compiler Platform, codenamed Roslyn, on April 3rd, 2014. The code is available at http://roslyn.codeplex.com/ for »

Writing your own Convert.ToBase64String in C#

Have you ever wondered what Base64 is? How it works? Why you need it? Have you ever wanted to write your own Base64 encoder? Well, my »

Converting an int to a binary string in C#

The .NET Framework has a built in overload of Convert.ToString which takes 2 parameters: the int you want to convert and an int of the »

When doing string concatenation in C#, why don't you have to call ToString on non string variables?

To get the string representation of a variable, in this case we’ll use int, there is no implicit conversion from int to string so you »

Avoid using the is keyword in C#

The C# language has the is keyword which allows you to check if a variable is of a given type. if(myVar is MyClass) This is »

Was the .NET Framework a Failure?

I’m a big, big fan of the .NET Framework. I have always felt that the whole framework is a very well thought out, organized and »

Fun times with string.join in C#

I had an interesting issue the other day at work regarding string.Join. I had overridden ToString in one of my classes to easily output values »

Avoid Commenting Your Code

When I’m answering questions on Stack Overflow, I see a lot of questions with code like this: // Convert our ciphertext into a byte array. byte[ »