My C# Wish List


I really like C#, but I wish there were a bit more to the language. The Visual Studio team has set up a UserVoice page so you can vote on your own favorites. I have placed some votes already, but here’s what I’m wanting:

String Interpolation

I want something like this mostly because I hate writing string.Format and/or creating .Format() type extension methods.

Overriding the ?? Operator

I would love to be able to override/extend the null-coalescing operator (??) in C#. This way “string like” objects could combine checks for null, empty, whitespace, etc. Like anything, I’m guessing this could be abused if not used properly. Also, I know I’ve wanted to do this, but can’t come up with a good example to share. I know others have thought that this would be helpful, anybody willing to share an example?

“Anonymous Tuples”

I don’t know what this is actually called, but I’d like to write this code in some instances:

I think this could make things cleaner and easier to read in several circumstances.

I accidentally the code