Dynamic
Diller
Simple and succinct
Implicitly typed
Meta-programming
No compilation
Static
Diller
Robust
Performant
Intelligent tools
Better scaling
Slide 7
Slide 7 text
Property FirstName As String
Property LastName As String
Initializers:
Property ID As Integer = -1
Property Suppliers As New List(Of Supplier)
Slide 8
Slide 8 text
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()
Slide 9
Slide 9 text
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 array
Dim total = items.Count(Function(n)
Slide 10
Slide 10 text
Function Go(
ByVal x As Integer,
ByVal y As Integer
)
Dim query =
From n In {
123,
456,
}
Slide 11
Slide 11 text
Python
Binder
Ruby
Binder
COM
Binder
JavaScript
Binder
Object
Binder
Dynamic Language Runtime
Expression Trees Dynamic Dispatch Call Site Caching
IronPython IronRuby C# VB.NET Others…
Slide 12
Slide 12 text
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)