Why you Should Take Another Look at C# - GOTO...
Transcript of Why you Should Take Another Look at C# - GOTO...
http://stackoverflow.com/research/developer-survey-2016#technology-most-popular-technologies
http://stackoverflow.com/research/developer-survey-2016#technology-most-loved-dreaded-and-wanted
Run on Windows
Black box compilers
Edit in Visual Studio
Proprietary
Run everywhere
Open compiler APIs
Use your favorite editor
Open source
Evolution of C#
C# 1
Hello World
C# 2
Generics
C# 3Queries, Lambdas
C# 4Dynamic, Concurrency
C# 5
Async
C# 6Eliminate ceremony
C# 7
Work with data
if (o is Point(5, var y)) { WriteLine($"Y: {y}"); } // recursive patterns
state = match (state, request) // match expressions, match on tuples{
(Closed, Open) => Opened,(Closed, Lock) => Locked,(Opened, Close) => Closed,(Locked, Unlock) => Closed,
};
string? n; // Nullable reference type
string s; // Non-nullable reference type
n = null; // Sure; it's nullable
s = null; // Warning! Shouldn’t be null!
s = n; // Warning! Really!
WriteLine(s.Length); // Sure; it’s not null
WriteLine(n.Length); // Warning! Could be null!
if (n != null) { WriteLine(n.Length); } // Sure; you checked
WriteLine(n!.Length); // Ok, if you insist!