what to expect with c

20
Joseph Guadagno ([email protected]) Founder Southeast Valley .NET User Group Twitter: twitter.com/jguadagno

Upload: joseph-guadagno

Post on 12-Jul-2015

1.389 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: What To Expect With C

Joseph Guadagno ([email protected])FounderSoutheast Valley .NET User GroupTwitter: twitter.com/jguadagno

Page 2: What To Expect With C

Dynamic lookupNamed and optional parametersCOM specific interop featuresVariancePotential features

Page 3: What To Expect With C

The dynamic typeRuntime lookup

Dynamic objectsPlain objectsCOM objects

Page 4: What To Expect With C
Page 5: What To Expect With C

No syntax for class creation

Cannot find extension methods

Anonymous functions (ie Lamda expressions) cannot appear as arguments.

Page 6: What To Expect With C

Named parametersOptional parametersOverload resolution

Page 7: What To Expect With C

publ i c voi d Pr i nt Me( st r i ng t ext , i nt copi es, bool col l at e) ;

Pr i nt Me( t ext : “Hel l o Wor l d”, col l at e: t rue,

copi es: 1) ;

Page 8: What To Expect With C

publ i c voi d Pr i nt Me( st r i ng t ext , i nt copi es = 1, bool col l at e = t rue) ;

Pr i nt Me(“Hel l o Wor l d”) ;

Page 9: What To Expect With C

A signature is applicable if all its parameters are either optional or have exactly one corresponding argument (by name or position) in the call which is convertible to the parameter type.Betterness rules on conversions are only applied for arguments that are explicitly given – omitted optional arguments are ignored for betterness purposes.If two signatures are equally good, one that does not omit optional parameters is preferred.

Page 10: What To Expect With C

Pr i nt Me(“Hel l o Wor l d”) ;

publ i c voi d Pr i nt Me(st r i ng t ext , i nt copi es = 1) ;publ i c voi d Pr i nt Me(st r i ng t ext ) ;publ i c voi d Pr i nt Me(obj ect t ext ) ;

Page 11: What To Expect With C
Page 12: What To Expect With C

Dynamic importCompiling without PIAsOmitting ref

Page 13: What To Expect With C
Page 14: What To Expect With C

Some COM interfaces are not yet availableIndexed propertiesDefault propertiesNOTE: these will only be used for dynamically typed objects. C# static objects will not support them.

Page 15: What To Expect With C

Supported for interface and delegate types“Statically checked definition-site variance”Value types are always invariant

IEnumerable<int> is not IEnumerable<object>Similar to existing rules for arrays

ref and out parameters need invariant type

Page 16: What To Expect With C
Page 17: What To Expect With C

CompilerCompilerSource codeSource code

SourceFile

Source codeSource code

.NET Assembly

Class

Field

public Foo

private

string

X

Meta-programming Read-Eval-Print Loop

LanguageObject Model

DSL Embedding

Page 18: What To Expect With C
Page 19: What To Expect With C

Visual Studio 2010 and .NET 4.0 Traininghttp://cli.gs/VS2010training

The Future of C#, Anders Hejlsberghttp://cli.gs/FutureOfC

LINQ Farm: Covariance and Contravariance in C# 4.0

http://cli.gs/LinqFarm

Page 20: What To Expect With C

Joseph Guadagno ([email protected])FounderSoutheast Valley .NET User Group