.NET Brown Bag Xamarin/C# - cross platform * rich native

advertisement
THE FUTURE OF C#
KEVIN PILCH-BISSON
kevinpi@microsoft.com
MADS TORGERSEN
mads.torgersen@microsoft.com
PROJECT ROSLYN
A reimplementation of C# and VB compilers
In C# and VB
With rich public APIs
On CodePlex
WHY ROSLYN?
ROSLYN DEMO
Rich IDE experiences
Custom diagnostics
New language features
RICH IDE EXPERIENCES
Inline Rename with conflict detection
More refactorings:
 Introduce local
 Inline temp
Lightbulbs to quickly fix up your code
Small improvements throughout:
 Colorization in quick info, signature help, outlining tooltips
 Smarter case matching in Completion
CUSTOM DIAGNOSTICS
Easily detect common coding problems
Run live in the IDE
Can attach “quick fixes” to them as well
Run as part of command line/team builds
Distribute together with a library on NuGet
LANGUAGE FEATURES
Using static members
using System.Console; … Write(4);
Primary Constructors
class Point(int x, int y) { … }
Auto-property Initializers
public int X { get; set; } = x;
Getter-only auto-properties
public int Y { get; } = y;
Index initializers
new JObject { ["x"] = 3, ["y"] = 4 }
Declaration Expressions
int.TryParse(s, out var x);
Await in catch/finally
try { … } catch { await … } finally { await … }
Exception Filters
catch (E e) if (e.Count == 0) { }
Null Propagation Operator
customer?.Orders?[5].Price
CALL TO ACTION
Use the IDE and language features
Dip your toes in custom diagnostics
Consider forking the compiler source
Give us feedback
ROSLYN, C# AND VB RESOURCES
MSDN - http://www.msdn.com/roslyn
Roslyn Preview for VS 2013 - http://aka.ms/Roslyn
Download VS “14” CTP - http://www.visualstudio.com/en-us/downloads/visual-studio-14-ctp-vs
CodePlex - http://roslyn.codeplex.com
Roslyn source browser - http://source.roslyn.codeplex.com
Download