Louis de Klerk Consultant Inobits Consulting DTL308.

Post on 24-Dec-2015

215 views 0 download

Tags:

transcript

Future Directions for Visual Basic

Louis de KlerkConsultantInobits ConsultingDTL308

The Evolution of Visual Basic

Visual Basic 1.0-3.0

Visual 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

VB10 Language Featuresdemo

Auto-implemented Properties

Property FirstName As StringProperty LastName As String

Initializers:Property ID As Integer = -1Property 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)

Implicit Line Continuation

<Attribute()> Function Go( ByVal x As Integer, ByVal y As Integer )

Dim query = From n In { 123, 456, } Order By n Select n + x

PythonBinder

RubyBinder

COMBinder

JavaScriptBinder

ObjectBinder

.NET Dynamic Programming

Dynamic Language Runtime

Expression Trees Dynamic Dispatch Call Site Caching

IronPython IronRuby C# VB.NET Others…

Calling Python from VB.NETdemo

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))

Generic Variance

Dim apples As IEnumerable(Of Apple) = New List(Of Apple)

'Covariance (Apple inherits from Fruit)Dim fruits As IEnumerable(Of Fruit) = apples

'Contravariance - Func(Of In T, Out R)Dim predicate As Func(Of Fruit, Boolean) = Function(f) f.Color = "Red" apples.Where(predicate)

Compiling without PIAs

• 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. (Prevents assembly from becoming bloated)

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

Track Resources

VB Team Blog – http://blogs.msdn.com/vbteam

Beth Massi's Blog – http://blogs.msdn.com/bethmassi

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

Related Sessions ( .NET 4)When What Area Code

Mon 8:00 Future Directions for Visual Basic Languages DTL308

Mon 17:15 The State of Dynamic Languages on the Microsoft .NET Framework

Languages DTL304

Tues 9:15 Introduction to F# Languages DTL:319

Tues 16:15 The Future of C# Languages DTL310

Mon 9:15 The Manycore Shift: Making Parallel Computing Mainstream

CLR/BCL DTL206

Tues 17:30 Managed Extensibility Framework CLR/BCL DTL315

Tues 14:30 A First Look at WCF and WF in the Microsoft .NET Framework 4.0

Middle SOA201

Mon 17:15 The ADO.NET Entity Framework 4 Data DTL402

Tues 17:30 An Introduction to the ADO.NET Data Services Framework v1.5

Data DTL208

Related Sessions ( .NET 4)TIme Topic Area Code

Mon 15:45 Building Scalable and Available Web Applications with the Microsoft Code Name "Velocity"

Web WUX301

Tues 10:50 A Lap around Microsoft ASP.NET 4.0 and Microsoft Visual Studio 2010

Web WUX203

Wed 9:00 Taking AJAX to the Next Level** Web WUX306

Mon 8:00 Building Rich Business Clients in WPF: New Tools and Controls for Windows Presentation Foundation

Client WUX303

Tues 13:15 Microsoft Visual Studio 2010 Overview for the Business Application Developer

General DTL309

www.microsoft.com/teched

International Content & Community

http://microsoft.com/technet

Resources for IT Professionals

http://microsoft.com/msdn

Resources for Developers

www.microsoft.com/learning

Microsoft Certification & Training Resources

Resources Tech·Ed Africa 2009 sessions will be made available for download the week after the event from: www.tech-ed.co.za

Complete a session evaluation and enter to win!

10 pairs of MP3 sunglasses to be won

question & answer

© 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.