CLR: – Common platform for static languages – Facilitates great interop • Dynamic Language Runtime – DLR: – Common platform for dynamic languages – Facilitates great interop
false) is frankly enigmatic • Intended for use in demystifying calls to libraries outside your control, not to excuse designing bad and obscure APIs yourself
• Time heals all wounds – Except those inflicted by DCOM security • Uses OptionalAttribute and DefaultParameterValueAttribute – Does not create an overload – Compatible with Visual Basic
APIs that depended heavily on them • “No PIA” – Merges COM interop type definitions into the calling assembly so you don’t need to deploy a PIA – Runtime magic to identify COM types from multiple assemblies • Omitting stupid “ref missing” arguments
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()
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) Return (n Mod 2 = 0) End Function)
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)
the UI • Thread Affinity – Async Operations – Synchronization Issues On Multi-core Machine – As above... – ... plus Improve Actual Performance – ... plus create new user experiences