Upload
aboulfazlhadi
View
224
Download
0
Embed Size (px)
Citation preview
8/8/2019 Whats New in CSharp 4 and VB 10
1/22
Visual Studio 2010and
.NET Framework 4
Training Workshop
8/8/2019 Whats New in CSharp 4 and VB 10
2/22
Whats New In
C# 4.0 and Visual Basic 10
Name
TitleOrganization
8/8/2019 Whats New in CSharp 4 and VB 10
3/22
Where Were At Today
Our managed languages are starting to share somevery similar features:
Functional
Concise
Declarative
8/8/2019 Whats New in CSharp 4 and VB 10
4/22
8/8/2019 Whats New in CSharp 4 and VB 10
5/22
8/8/2019 Whats New in CSharp 4 and VB 10
6/22
Why Declarative Matters
Imperative Declarative
What
How
8/8/2019 Whats New in CSharp 4 and VB 10
7/22
Addressing Language Trends
Declarative
ConcurrentDynamic
8/8/2019 Whats New in CSharp 4 and VB 10
8/22
The Evolution of C#
C# 1.0
C# 2.0
C# 3.0
Managed Code
Generics
LINQ
C# 4.0
Dynamic
8/8/2019 Whats New in CSharp 4 and VB 10
9/22
New C# 4.0 Features
1. Late-Binding Support
2. Named and Optional Parameters
3. Improved COM Interop
4. Covariance and Contravariance
8/8/2019 Whats New in CSharp 4 and VB 10
10/22
Simplifying Your Code with C# 4.0
8/8/2019 Whats New in CSharp 4 and VB 10
11/22
Co-evolving C# and VB
Think ofco-evolution as agame of leap-frog
8/8/2019 Whats New in CSharp 4 and VB 10
12/22
Theres a problem when
co-evolution doesnt exist
8/8/2019 Whats New in CSharp 4 and VB 10
13/22
The Evolution of Visual Basic
VB1VB3
VB4-VB6
VB7-VB9
Windows ProgrammingMade Easy
ComponentsMade Easy
Power andSimplicity for
.NET
VB10
Continuingthe trend
8/8/2019 Whats New in CSharp 4 and VB 10
14/22
New VB10 Features
1. Auto-Implemented Properties
2. Collection Initializers
3. Statement Lambdas
4. Covariance and Contravariance
5. Implicit Line Continuation
8/8/2019 Whats New in CSharp 4 and VB 10
15/22
VB 10
8/8/2019 Whats New in CSharp 4 and VB 10
16/22
Why a Dynamic Language Runtime?
Common Language Runtime
Statically-Typed
C#VB
RubyPython
Dynamically-Typed
8/8/2019 Whats New in CSharp 4 and VB 10
17/22
Why a Dynamic Language Runtime?
Common Language Runtime
Statically-Typed
C#VB
RubyPython
Dynamically-Typed
Dynamic Language Runtime
8/8/2019 Whats New in CSharp 4 and VB 10
18/22
PythonBinder
RubyBinder
COMBinder
JScriptBinder
ObjectBinder
.NET Dynamic Programming
Dynamic Language Runtime
Expression Trees Dynamic Dispatch Call Site Caching
IronPython IronRuby C# VB.NET Others
8/8/2019 Whats New in CSharp 4 and VB 10
19/22
Dynamically Typed Objects
Calculator calc = GetCalculator();int sum = calc.Add(10, 20);
object calc = GetCalculator();
Type calcType = calc.GetType();
object res = calcType.InvokeMember("Add",
BindingFlags.InvokeMethod, null,new object[] { 10, 20 });
int sum = Convert.ToInt32(res);ScriptObject calc = GetCalculator();
object res = calc.Invoke("Add", 10, 20);
int sum = Convert.ToInt32(res);
dynamic calc = GetCalculator();int sum = calc.Add(10, 20);
Statically typedto be dynamic
Dynamic methodinvocation
Dynamicconversion
8/8/2019 Whats New in CSharp 4 and VB 10
20/22
Dynamic Language Interop
8/8/2019 Whats New in CSharp 4 and VB 10
21/22
Summary
1. Targeting the current trends in programminglanguages
2. Addressing current pain points in developing forWindows and the .NET Framework
3. Laying the foundation to enable developers tosolve tomorrows problems
8/8/2019 Whats New in CSharp 4 and VB 10
22/22