donetconf2016: the future of c#

27
The Future of C# Jon Limjap Microsoft MVP for Visual Studio and Development Technologies Philippine .NET Users Group Lead

Upload: jacinto-limjap

Post on 21-Jan-2018

558 views

Category:

Technology


0 download

TRANSCRIPT

The Future of C#Jon Limjap

Microsoft MVP for Visual Studio and Development Technologies

Philippine .NET Users Group Lead

About Me

Microsoft MVP for Visual Studio and Development Technologies

CTO & Co-Founder, Nomad Travlr Inc.

Lead, Philippine .NET Users Group

http://jonlimjap.net

@lattex | [email protected]

Philippine .NET Users Group (PHINUG)

facebook.com/groups/phinug

Where is Microsoft today?Free or paid? Cheap or expensive? Open source or proprietary? Good or evil?

Exciting times ahead for .NET

.NET FRAMEWORK .NET CORE XAMARIN

AP

P

MO

DELS

BA

SE

LIB

RA

RIE

S

*

.NET today—app models and libraries

.NET FRAMEWORK .NET CORE XAMARIN

AP

P

MO

DELS

BA

SE

LIB

RA

RIE

S

.NET today—reusing code

.NET today—challenges

.NET tomorrow

.NET FRAMEWORK .NET CORE XAMARIN

*

.NET tomorrow—reusing code

.NET FRAMEWORK .NET CORE XAMARIN

.NET standard libraries—advantages

.NET future innovation

.NET FRAMEWORK .NET CORE XAMARIN

*

TOOLS

Developed in the open

http://dotnet.github.io

http://stackoverflow.com/research/developer-survey-2016#technology-most-popular-technologies

Most popular technologies

http://stackoverflow.com/research/developer-survey-2016#technology-most-loved-dreaded-and-wanted

Most loved technologies

http://stackoverflow.com/research/developer-survey-2016#technology-most-loved-dreaded-and-wanted

Most dreaded technologies

Microsoft’s changing tune…

Run on Windows

.NET as system component

Run on VM (CLR)

Black box compilers

Edit in Visual Studio

Proprietary

Run everywhere

Deploy with app

Compile to native

Open compiler APIs

Use your favorite editor

Open source

C# 7It’s getting funkier every version!

Digit separators

int bin = 0b1001_1010_0001_0100;int hex = 0x1b_a0_44_fe;int dec = 33_554_432;int weird = 10000_000;double real = 1_000.111_1e-1_000;

Binary Literals int nineteen = 0b10011;

Ref returns and Ref Locals

string[] myArray = { "one", "two", "three" };

WriteLine($"The first element of the array is {myArray[0]}");

ref string n = ref FirstElement(myArray);n = "other"; //myArray[0] now equals "other"

WriteLine($"The first element of the array has become {myArray[0]}");

Local Functions

class Program {

static void Main(string[] args){

void testingLocalFunctions(){

Console.WriteLine("Hello World!");}

testingLocalFunctions();}

}

C# 7 features that are still… wonky

Tuples

public (int x, int y) Compute(){}// Call the methodvar (x,y) = Compute();

public (int sum, int count) Tally(IEnumerable<int> values){

sum = 0; count = 0;foreach (var value in values) { sum += value; count++; }return (sum,count);

}

Pattern Matching

int? age = 5;if (age is int newVal){

Console.WriteLine($"Your age is {newVal}");}

Record Types

//Instead of:public class Cube{

public int Width { get; set; }public int Height { get; set; }public int Depth { get; set; }

}

//We write this:public class Cube(int Width, int Height, int Depth)

Philippine .NET Users Group (PHINUG)

facebook.com/groups/phinug