What email address or phone number would you like to use to sign in to Docs.com?
If you already have an account that you use with Office or other Microsoft services, enter it here.
Or sign in with:
Signing in allows you to download and like content, and it provides the authors analytical data about your interactions with their content.
Embed code for: What is New in C# 7
Select a size
What is New in C# 7.0
Who Am I?
Microsoft C# MVP
Passionate about continuous improvements
Leading software development projects
Design cloud ready software solutions
Contribute to SS .NET Community
More … go to
C# 7.0: How Do I Get It?
Visual Studio 2017
Roslyn compiler from GitHub
Numeric literal syntax improvements
out variables (+ discards)
More expression-bodied members
Generalized async return types
ref locals and returns
Tuples (+ deconstruction)
var million = 10_000_________000;
byte b = 0b1010_1011;
How it works
What’s wrong with out parameters
Cannot user var to declare them
Must declare out variable before calling method
Do you feel that you need more?
Get and set accessors on properties and indexers
NuGet package -
Not replace Task, but help to
drastically reduce the number of allocations
Lambdas cannot be called before declaration
Do not require allocating a delegate object
MSIL can generate a private method, but restrict access to one function
Avoiding copying values
Skip dereferencing operations multiple times
What’s wrong with Tuples
How to pronounce “tuple”?
What problem are we trying to solve?
Getting more than one value returned from method
Out parameters do not cut it
They are clunky
They cannot be used with async methods
Verbose and require allocation of tuple object
Anonymous types returned through dynamic return type
High performance overhead
No static type checking
Tuples can be freely converted to other Tuple types
There are warnings or errors if you swap the names, etc.
Tuples are value types with natural Equals and GetHashCode implementations
E.g. dictionary with multiple keys
Tuple elements are public, mutable fields
ValueTuple is not binary serializable
Pattern matching definition
Test that a value has a certain “shape” and extract information when it does
C# 7.0 supported patterns
C# is a modern language that takes the good stuff from everywhere
The evolution process is in the open – just follow the issues and the PRs
Structs can improve memory performance
Less GC pressure
Better memory locality
Less overall space usage
New Features in C# 7.0
C# 7.0 language design
The official repo for the design of the C# programming language
@ky7m | ifesenko.com | email@example.com
© 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Microsoft Ignite 2016
@ky7m | ifesenko.com | ifesen@softservei