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

.NET Framework 4 ve Visual Studio 2010 Yenilikleri

.NET Framework 4 ve Visual Studio 2010 Yenilikleri

Daron Yondem

March 25, 2010
Tweet

More Decks by Daron Yondem

Other Decks in Programming

Transcript

  1. .NET Framework 4 ve
    Visual Studio 2010
    Yenilikleri
    Daron Yöndem
    Microsoft Regional Director
    Silverlight MVP

    View Slide

  2. C# 4.0
    • Dynamic typing
    • Generic variance
    • Named arguments
    • Optional parameters
    • COM interop enhancements

    View Slide

  3. The DLR on the CLR
    • Common Language Runtime – CLR:
    – Common platform for static languages
    – Facilitates great interop
    • Dynamic Language Runtime – DLR:
    – Common platform for dynamic languages
    – Facilitates great interop

    View Slide

  4. Named arguments
    • Because Foo(37, 28, 93, 18, true, true, false) is
    frankly enigmatic
    • Intended for use in demystifying calls to
    libraries outside your control, not to excuse
    designing bad and obscure APIs yourself

    View Slide

  5. Optional parameters
    • Were evil in 2002
    – Versioning considerations
    • Time heals all wounds
    – Except those inflicted by DCOM security
    • Uses OptionalAttribute and
    DefaultParameterValueAttribute
    – Does not create an overload
    – Compatible with Visual Basic

    View Slide

  6. COM interop enhancements
    • Named and optional arguments support COM
    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

    View Slide

  7. Visual Basic Gelişimi
    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+

    View Slide

  8. VB ve C# Kardeşliği
    Hepimiz kardeşiz!

    View Slide

  9. Trendler
    Declarative
    Concurrent
    Dynamic

    View Slide

  10. Declarative Programlama
    Ne
    Nasıl
    Imperative Declarative

    View Slide

  11. Dynamic - Static
    Dynamic
    Diller
    Simple and
    succinct
    Implicitly typed
    Meta-
    programming
    No compilation
    Static
    Diller
    Robust
    Performant
    Intelligent tools
    Better scaling

    View Slide

  12. Auto-implemented Properties
    Property FirstName As String
    Property LastName As String
    Initializers:
    Property ID As Integer = -1
    Property Suppliers As New List(Of Supplier)

    View Slide

  13. 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()

    View Slide

  14. 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 array
    Dim total = items.Count(Function(n)
    Return (n Mod 2 = 0)
    End Function)

    View Slide

  15. Implicit Line Continuation

    Function Go(
    ByVal x As Integer,
    ByVal y As Integer
    )
    Dim query =
    From n In {
    123,
    456,
    }
    Order By n
    Select n +
    x

    View Slide

  16. Python
    Binder
    Ruby
    Binder
    COM
    Binder
    JavaScri
    pt
    Binder
    Object
    Binder
    .NET Dynamic Programming
    Dynamic Language Runtime
    Expression Trees Dynamic Dispatch Call Site Caching
    IronPython IronRuby C# VB.NET Others…

    View Slide

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

    View Slide

  18. Threading/Concurrency ->
    Parallelism
    On Single Core Machine
    – Don’t block the UI
    • Thread Affinity
    – Async Operations
    – Synchronization Issues
    On Multi-core Machine
    – As above...
    – ... plus Improve Actual Performance
    – ... plus create new user experiences

    View Slide

  19. Visual Studio 2010
    • Data Tips
    • BreakPoints
    • Intellitrace
    • Dump Files!

    View Slide

  20. Sorular?

    View Slide

  21. TEŞEKKÜRLER
    Daron Yöndem
    [email protected]
    http://daron.yondem.com

    View Slide