locked
What's new in C# 5.0? RRS feed

  • Question

  • Is there an exhaustive list of new features in C# 5.0?  I have searched the internet and found only 3 notable updates:

    - Async
    - closure in lamba expressions
    - Caller Information

    This strikes me as a trivial update compared to every other major C# release.  Is that really all there is?


    Blog

    Thursday, August 23, 2012 2:12 PM

Answers

  • Is there an exhaustive list of new features in C# 5.0?  I have searched the internet and found only 3 notable updates:

    - Async
    - closure in lamba expressions
    - Caller Information

    This strikes me as a trivial update compared to every other major C# release.  Is that really all there is?

    You really think that `async` is a trivial update?  It's a rather huge new feature that (has the potential to) dramatically change the coding practices in a large percentage of applications.  It's also not a trivial feature to implement.  `async` is the central feature of C# 5.0; most of the rest are small little changes that are not featured.  Most of the C# releases have one central feature, and in 5.0 `async` is it.

    Now, are there other changes, yes, I'm sure there are, but they will be primarily bugfixes or small changes that are not designed to fundamentally change how you use the language.

    • Edited by servy42 Thursday, August 23, 2012 2:57 PM
    • Marked as answer by P.Brian.Mackey Thursday, August 23, 2012 3:53 PM
    Thursday, August 23, 2012 2:56 PM

All replies

  • - closure in lamba expressions

    Closure in C# is as old as anonymous functions. That would be C# 2.0. Closure in lambda expressions is as old as lambda expressions: C# 3.0.

    Thursday, August 23, 2012 2:40 PM
  • - closure in lamba expressions

    Closure in C# is as old as anonymous functions. That would be C# 2.0. Closure in lambda expressions is as old as lambda expressions: C# 3.0.

    My guess is it's a reference to the fact that `foreach` loops will now have the loop variable inside of the loop, rather than outside of the loop, which means that closing over the loop variable with a lambda that escapes the loop will result in each closure having that iteration's value, rather than the last iteration, which is the more intuitive result.
    Thursday, August 23, 2012 2:53 PM
  • Is there an exhaustive list of new features in C# 5.0?  I have searched the internet and found only 3 notable updates:

    - Async
    - closure in lamba expressions
    - Caller Information

    This strikes me as a trivial update compared to every other major C# release.  Is that really all there is?

    You really think that `async` is a trivial update?  It's a rather huge new feature that (has the potential to) dramatically change the coding practices in a large percentage of applications.  It's also not a trivial feature to implement.  `async` is the central feature of C# 5.0; most of the rest are small little changes that are not featured.  Most of the C# releases have one central feature, and in 5.0 `async` is it.

    Now, are there other changes, yes, I'm sure there are, but they will be primarily bugfixes or small changes that are not designed to fundamentally change how you use the language.

    • Edited by servy42 Thursday, August 23, 2012 2:57 PM
    • Marked as answer by P.Brian.Mackey Thursday, August 23, 2012 3:53 PM
    Thursday, August 23, 2012 2:56 PM