Karen Liu Microsoft Dev 339download.microsoft.com/documents/hk/technet/techdays2009/...Source...

Post on 04-Nov-2020

3 views 0 download

Transcript of Karen Liu Microsoft Dev 339download.microsoft.com/documents/hk/technet/techdays2009/...Source...

Karen LiuIDE Lead Program ManagerMicrosoftDev 339

The Evolution of Visual Basic

Visual Basic

1.0-3.0Visual Basic

4.0-6.0

Visual Basic

7.0-9.0

Visual Basic 10.0

Visual Basic 11.0+

VB's Fraternal Twin: C#Co-Evolution

Trends

Declarative

ConcurrentDynamic

Declarative Programming

What

How

Imperative Declarative

Dynamic vs. Static

DynamicLanguages

Simple and succinct

Implicitly typed

Meta-programming

No compilation

StaticLanguages

Robust

Performant

Intelligent tools

Better scaling

Concurrency

VB 10 Language FeaturesKaren LiuVB/C# IDE Lead Program ManagerMicrosoft

What you saw

Implicit line continuation

Automatically implemented properties

Collection initializers

Array literals

Statement lambdas

Implicit Line Continuation

<Attribute()>Function Go(

ByVal x As Integer,ByVal y As Integer

)

Dim query =From n In {

123,456,}

Order By nSelect n +

x

Auto-implemented Properties

Property FirstName As String

Property LastName As String

Initializers:

Property ID As Integer = -1

Property Suppliers As New List(Of Supplier)

Collection Initializers

Dim x As New List(Of Integer) From {1, 2, 3}

Dim list As New Dictionary(Of Integer, String) From

{{1, “Bart”},

{2, “Lisa”},

{3, “Homer”}}

Array Literals:

Dim a = {1, 2, 3} 'infers Integer()

Dim b = {1, 2, 3.5} 'infers Double()

Statement Lambdas

Dim items = {1, 2, 3, 4, 5}

Array.ForEach(items, Sub(n) Console.WriteLine(n))

Array.ForEach(items, Sub(n)

If n Mod 2 = 0 Then Console.WriteLine(n)End Sub)

'Count the number of even items in the arrayDim total = items.Count(Function(n)

Return (n Mod 2 = 0)End Function)

PythonBinder

RubyBinder

COMBinder

JavaScriptBinder

ObjectBinder

.NET Dynamic Programming

Dynamic Language Runtime

Expression Trees Dynamic Dispatch Call Site Caching

IronPython IronRuby C# VB.NET Others…

VB 10 –Dynamic InteropKaren LiuIDE Lead Program ManagerMicrosoft

Interop with Dynamic Languages

'Load a file from Python into memoryDim random As Object = python.UseFile("random.py")

Dim items = {1, 2, 3, 4, 5, 6, 7}

'Dynamic (late-bound) call to Python functionrandom.shuffle(items)

'Print out the shuffled arrayArray.ForEach(items, Sub(n) Console.WriteLine(n))

Interop Type Embedding ("No Pia")

• Use PIAs at design-time, not runtime

• No need to deploy PIA to user’s machine

• Compiler embeds the specific members of the specific types used into your assembly

Compiler as a Service

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

Compiler as a ServiceKaren LiuVB/C# IDE Lead Program ManagerMicrosoft

Summary

Declarative

ConcurrentDynamic

http://microsoft.com/technet

Resources for IT Professionals

http://microsoft.com/msdn

Resources for Developers

www.microsoft.com/learning

Microsoft Certification & Training Resources

Resources

Related Content

Dev352 (R) – Increase Your Productivity with the Visual Studio 2010 IDE

DTL339 (R) – Future Directions for Microsoft Visual Basic

Dev423 – How LINQ Works: A Deep Dive into the Microsoft Visual Basic and C# Implementations

Track Resources

VB Team Blog – http://blogs.msdn.com/vbteamBeth Massi’s Blog - http://blogs.msdn.com/bethmassi

MSDN VBasic Site – http://msdn.com/vbasic

VB 10 Whitepaper -http://code.msdn.microsoft.com/vbfuture/Release/ProjectReleases.aspx?ReleaseId=1699

VB Developer Center - http://msdn.com/vbasic

Questions? Comments? Requests? Email me at karenliu@microsoft.com

Complete an

evaluation on

CommNet and

enter to win!

© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS,

IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.