C# - vNext

I've been reading lately about what people are interested in with the next version of C#.  It's amazing to think how far the language has come from the early days.  Many of the newer features of the language with 3.0 by far have made it a better language.

So, what did we get with the latest C# 3.0?

  • Object Initializers
  • Automatic Properties  
  • Anonymous Types
  • Extension Methods
  • Lambda Expressions
  • LINQ
  • Collection Initializers

By far, I agree with most of sentiments regarding C# vNext, including:

  • Mixins
  • Ruby-like Symbols
  • Hash language features
  • Automatic Delegation

I'll throw Spec# features and Duck Typing onto the pile.  As you may note from my earlier posts, parts already exist in.NET 3.5 libraries, so it's not hard to imagine that might open up a bit.  Plus, since I've given several presentations on the matter, I'm pretty into it.  But, also some of F#'s features are great as well that I'd like to see more merging includes mutables.  A good introduction to F# can be found.  But, then again, why not just stick to F#?

What might in store for C# 4.0 anyhow?  Well, if you follow Eric Lippert, one of Microsoft's best bloggers, like I do, there are some things that are very interesting that he's been working on including ) with his ten post series:

Each of these are worth a read:

Also, could immutability be another thing coming?  If you're a follower of Domain Driven Design, you like Value Objects and Immutability.  Spec# also introduces this concept to C# as well through the use of attributes.  And since parts of Spec# covers this, it's also very likely.  Anyhow, Eric Lippert also covers this in a "hypothetical way":

But, with all new features, there are diminishing returns as noted by.  I'd have to agree with this point.  At some point, what are these new features going to give you when other languages can do these things more naturally?  If, say C# doesn't have a certain feature, but IronRuby does, why not use IronRuby?  Also, keeping on piling on features will ultimately make the language more complex and sifting through the various answers to find the right one becomes a bit harder.

I disagree with others like Jeremy that call for an end and stick a fork in C#.  It's not done yet and I think it holds much more promise before we call it a day.

kick it on DotNetKicks.com

This article is part of the GWB Archives. Original Author: Matthew Podwysocki

New on Geeks with Blogs

  • We Won The One Award I Actually Care About

    Full Scale made the Inc. 5000 for the fifth year straight, the 12th listing across my three companies. Here is why the one award you cannot buy is worth stopping for.

  • Your Customers Build the Features Now

    I let a tool I liked sit dead for a year rather than build the features I wanted. An MCP server meant I never had to, and your customers can do the same to your product.

  • Get the Size of a Directory in Linux the Easy Way

    du -sh for the quick answer, ncdu for the cleanup, df for the disk itself: every command for checking directory size in Linux, plus why du and df never agree.

  • Vim Search and Replace: The Ultimate Guide

    One :%s command replaces every match in a file before a find dialog would even open. The Vim substitute patterns worth the muscle memory: flags, ranges, capture groups, and multi-file edits.