Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Visual Basic 10

Visual Basic 10

Daron Yondem

December 02, 2009
Tweet

More Decks by Daron Yondem

Other Decks in Programming

Transcript

  1. Dynamic Diller Simple and succinct Implicitly typed Meta-programming No compilation

    Static Diller Robust Performant Intelligent tools Better scaling
  2. Property FirstName As String Property LastName As String Initializers: Property

    ID As Integer = -1 Property Suppliers As New List(Of Supplier)
  3. 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()
  4. 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)
  5. <Attribute()> Function Go( ByVal x As Integer, ByVal y As

    Integer ) Dim query = From n In { 123, 456, }
  6. 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…
  7. 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)