c# and the evolution of a programming language

Download C# and the Evolution of a Programming Language

If you can't read please download the document

Upload: jacinto-limjap

Post on 13-Apr-2017

388 views

Category:

Technology


2 download

TRANSCRIPT

Coding Sharp with C#

C# and the Evolution of a Programming Language

Jon LimjapMicrosoft MVP for Visual Studio and Development TechnologiesPhilippine .NET Users Group Lead

About Me

Senior Software Architect, Beam And Go

Microsoft MVP for Visual Studio and Development Technologies

Philippine .NET Users Group Lead

@lattex | [email protected]

IMG_3651.JPGPhilippine .NET Users Group (PHINUG)

facebook.com/groups/phinug

@phinug

phinug.doorkeeper.jp

Agenda

.NET Defined

What is C#?

A brief history of C#

A preview of C# 7

.NET Defined

Microsofts open source software development ecosystem

Ecosystem

Common Language Runtime

C#Visual Basic.NETF#Common Language RuntimePC / TabletWindows Phone (RIP)Windows ServerMac / LinuxAndroid / iOSIntermediate LanguageTools

Visual Studio 2015 Community Edition

More on open sourced .NET

Visit http://microsoft.github.io

What is C#?

See sharp. Not see hash, or see pound

C# as a language

Object Oriented

Strongly Typed

Declarative

Imperative

Functional

Generic

History

Continuous evolution of the C# language

History

Designed by Anders Hejlsberg

Originally named COOL (C-like Object-Oriented Language)

First released in 2000

C# 7 is in Preview

IMG_3643.JPGFanboy Moment

IMG_3651.JPGC# 2.0
November 2005

Generics

Partial Classes

Anonymous Methods

Iterators

Nullable Types

Static Classes

More

C# 3.0
Novermber 2007

Implicitly typed variables aka var keyword

Object and collection initializers

Auto-properties

Anonymous Types

Extension Methods

Language Integrated Query (LINQ)

Lambda Expressions

More

C# 4.0
April 2010

Dynamic Binding

Named and Optional Parameters

Generic Covariance and Contravariance

More

C# 5.0
August 2012

Asynchronous methods (async and await keywords)

Caller info attributes

C# 6.0
July 2015

Using statements for static members

Auto-property Initializers

Getter-only automatic properties

Dictionary Initializers

Expression-bodied members

Await inside a finally block

Exception Filters

Null-conditional operators

String interpolation

And a few more

C# 7.0

Its getting funkier every version!

Local Functions

class Program
{
static void Main(string[] args)
{
void testingLocalFunctions()
{
Console.WriteLine("Hello World!");
}testingLocalFunctions();
}
}Digit separators

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

int nineteen = 0b10011;Pattern Matching

int? age = 5;
if (age is int newVal)
{
Console.WriteLine($"Your age is {newVal}");
}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]}");C# 7 features that will probably be released but are not available yet

Tuples

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

public (int sum, int count) Tally(IEnumerable values)
{
sum = 0; count = 0;
foreach (var value in values) { sum += value; count++; }
return (sum,count);
}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)
Question & Answer


Thank you and please join the PHINUG FB Group!

facebook.com/groups/phinug

Click to edit Master title style

Click to edit Master text styles

Second level

Third level

Fourth level

Fifth level

6/4/2016

Click to edit Master title style

Click to edit Master subtitle style

6/4/2016

Click to edit Master title style

Click to edit Master text styles

Second level

Third level

Fourth level

Fifth level

6/4/2016

Click to edit Master title style

Click to edit Master text styles

6/4/2016

Click to edit Master title style

Click to edit Master text styles

Second level

Third level

Fourth level

Fifth level

Click to edit Master text styles

Second level

Third level

Fourth level

Fifth level

6/4/2016

Click to edit Master title style

Click to edit Master text styles

Click to edit Master text styles

Second level

Third level

Fourth level

Fifth level

Click to edit Master text styles

Click to edit Master text styles

Second level

Third level

Fourth level

Fifth level

6/4/2016

Click to edit Master title style

6/4/2016

6/4/2016

Click to edit Master title style

Click to edit Master text styles

Second level

Third level

Fourth level

Fifth level

Click to edit Master text styles

6/4/2016

Click to edit Master title style

Click icon to add picture

Click to edit Master text styles

6/4/2016

Click to edit Master title style

Click to edit Master text styles

Second level

Third level

Fourth level

Fifth level

6/4/2016

Click to edit Master title style

Click to edit Master text styles

Second level

Third level

Fourth level

Fifth level

6/4/2016