C# 4.0 – What’s new?
                     Venketash (Pat) Ramadass
         Systems Architect & Managing Director
        ...
Before all of that...

    Who here is primarily using VS 2003 and .NET 1.1?


    Who here is primarily using VS 2005 an...
Items we are going to Cover...

    What’s new in VS 2010



    What’s new in .NET 4.0



    What’s new in c# 4.0



...
What’s new in VS 2010
What’s new in VS 2010 – General
    .NET Framework 4.0


    Tooling and Framework advancements that take advantage

   ...
What’s new in VS 2010 – TDD
What’s new in VS 2010 – Web Development

    Full inclusion of:

    ◦ ASP .NET MVC
    ◦ JQuery
    ◦ Sliverlight

    I...
What’s new in VS 2010 – SharePoint
Development
  New Project Templates

 Import content using WSP Import
What’s new in VS 2010 – SharePoint
Development
What’s new in VS 2010 – Other
    Windows 7 Development

    ◦ Updates to MFC to support Windows 7, including new UI elem...
What’s new in VS 2010 – Team System -
Rosario
    Who here uses VSTS and/or VSTFS?

    ◦ What features/aspects do you us...
What’s new in VS 2010 – Test Impact View
What’s new in VS 2010 – Team System –
Architecture Explorer
What’s new in .net 4.0
What’s new in .net 4.0 – Some Highlights

    Updates to BCL – Base Class Lilbrary



    Code Contracts

    ◦ System.D...
What’s new in .net 4.0 – Some Highlights

    BigInteger

    ◦ System.Numerics.BigInteger
    ◦ Supports all standard In...
What’s new in c# 4.0
What’s new in c# 4.0

    Onto why we’re actually here...



    ◦ Dynamic Lookup

    ◦ Named and Optional Arguments

  ...
What’s new in c# 4.0 – Dynamic Lookup

    New dynamic type



    Resolution of method calls or field accesses is

    ...
What’s new in c# 4.0 – Dynamic Lookup
Demo
What’s new in c# 4.0 – Dynamic Lookup

    DLR – Dynamic Language Runtime is underlying

    mechanism

    This could be...
What’s new in c# 4.0 – Named and Optional
Arguments

    Historically multiple overloads were required to

    achieve th...
What’s new in c# 4.0 – Named and Optional
Arguments Demo
What’s new in c# 4.0 – Features for COM
Interop
    Dynamic import allows you to import COM APIs so that

    variants ar...
What’s new in c# 4.0 – Features for COM
Interop

    COM APIs use a lot of ref parameters. In c# 4.0 the

    compiler al...
What’s new in c# 4.0 – Variance
    Variance is one of those things most of us don’t

    often don’t have to think about...
What’s new in c# 4.0 – Variance
    The following example does not work even though

    string obviously inherits from o...
What’s new in c# 4.0 – Variance
    There may however be times where you would

    want to have this type of thing happe...
What’s new in c# 4.0 – Covariance and
Contravariance Demo
Conclusion

    A lot of great new technologies and tools coming

    out very soon

    There are some key advancements ...
References
    http://www.microsoft.com/visualstudio/en-

    us/products/2010/default.mspx
    ◦ Visual Studio 2010 main...
Questions?
Upcoming SlideShare
Loading in...5
×

C# 4.0 - Whats New

14,010

Published on

Published in: Technology
1 Comment
3 Likes
Statistics
Notes
No Downloads
Views
Total Views
14,010
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
1
Likes
3
Embeds 0
No embeds

No notes for slide

Transcript of "C# 4.0 - Whats New"

  1. 1. C# 4.0 – What’s new? Venketash (Pat) Ramadass Systems Architect & Managing Director emediaIT Email Address: pat.ramadass@emediait.com Blog: http://patramadass.emediait.com
  2. 2. Before all of that... Who here is primarily using VS 2003 and .NET 1.1?  Who here is primarily using VS 2005 and .NET 2.0?  Who here is primarily using VS 2008 and .NET 3.5?  ◦ What features are you using?  WPF, WCF, WF LINQ etc? Who has played with VS 2010 CTP?  ◦ Available for download
  3. 3. Items we are going to Cover... What’s new in VS 2010  What’s new in .NET 4.0  What’s new in c# 4.0  Questions  Note: All of these technologies are still new and are  still maturing through CTPs followed by Betas/RCs
  4. 4. What’s new in VS 2010
  5. 5. What’s new in VS 2010 – General .NET Framework 4.0  Tooling and Framework advancements that take advantage  of the latest trends including: ◦ Cloud Development  Windows Azure and similar ◦ Parallel Computing  Taking advantage of multi-core systems Updated editor built in WPF  ◦ Graphical view of source files, code coverage etc Simplified and more powerful TDD  ◦ Consume first declare second
  6. 6. What’s new in VS 2010 – TDD
  7. 7. What’s new in VS 2010 – Web Development Full inclusion of:  ◦ ASP .NET MVC ◦ JQuery ◦ Sliverlight Improved JavaScript IntelliSense engine  Improved SharePoint tools and project templates  ◦ VS 2010 Tools for SharePoint  Replacement for SharePoint Designer
  8. 8. What’s new in VS 2010 – SharePoint Development New Project Templates   Import content using WSP Import
  9. 9. What’s new in VS 2010 – SharePoint Development
  10. 10. What’s new in VS 2010 – Other Windows 7 Development  ◦ Updates to MFC to support Windows 7, including new UI elements Office Business Application Development  ◦ Build Office client applications that span multiple versions and target 32-bit/64-bit as using a single deployment package “Dublin” and “Oslo” in pipeline  ◦ “Dublin” will provide enhanced server capabilities, building on IIS for WCF and WF application hosting ◦ “Oslo” is a modelling platform for model-driven applications  “M” Language – Authoring domains textually  Quadrant – Tool for authoring domains visually  Library of pre-built domain models
  11. 11. What’s new in VS 2010 – Team System - Rosario Who here uses VSTS and/or VSTFS?  ◦ What features/aspects do you use? Highlights include:  ◦ “Democratizing” Application Lifecycle Management  Architectural consistency  Limiting “No-Repro” bugs ◦ Improved modelling  Technical and non-technical users ◦ Improved QA/Test Planning and execution  Microsoft Test Runner ◦ Snapshot of system data ◦ Partial/full video capture  Test Impact View
  12. 12. What’s new in VS 2010 – Test Impact View
  13. 13. What’s new in VS 2010 – Team System – Architecture Explorer
  14. 14. What’s new in .net 4.0
  15. 15. What’s new in .net 4.0 – Some Highlights Updates to BCL – Base Class Lilbrary  Code Contracts  ◦ System.Diagnostics.Contracts ◦ Language agnostic ◦ Specify Pre-conditions, post-conditions and objects invariants Parallel Extensions  ◦ Task Parallel Library, Parallel LINQ
  16. 16. What’s new in .net 4.0 – Some Highlights BigInteger  ◦ System.Numerics.BigInteger ◦ Supports all standard Integer operations Compression Improvements  ◦ Removed 4GB stream limit Various WCF and WF enhancements  ASP.NET  ◦ Static Client Ids ◦ Chart Control
  17. 17. What’s new in c# 4.0
  18. 18. What’s new in c# 4.0 Onto why we’re actually here...  ◦ Dynamic Lookup ◦ Named and Optional Arguments ◦ Features for COM Interop ◦ Variance
  19. 19. What’s new in c# 4.0 – Dynamic Lookup New dynamic type  Resolution of method calls or field accesses is  deferred until runtime Allows for calling or accessing identical methods  or properties across unrelated objects
  20. 20. What’s new in c# 4.0 – Dynamic Lookup Demo
  21. 21. What’s new in c# 4.0 – Dynamic Lookup DLR – Dynamic Language Runtime is underlying  mechanism This could be done before, using reflection or  interfaces etc, but it would require much more work Convenience comes with drawbacks  ◦ Performance  Reflection is used underneath ◦ Only have runtime checking
  22. 22. What’s new in c# 4.0 – Named and Optional Arguments Historically multiple overloads were required to  achieve this type of thing in c# ◦ Named parameters were never possible Now this can be done using the optional argument  syntax in a single constructor
  23. 23. What’s new in c# 4.0 – Named and Optional Arguments Demo
  24. 24. What’s new in c# 4.0 – Features for COM Interop Dynamic import allows you to import COM APIs so that  variants are represented using dynamic type instead of object. Code that looked like... ...could now look like...
  25. 25. What’s new in c# 4.0 – Features for COM Interop COM APIs use a lot of ref parameters. In c# 4.0 the  compiler allows you to omit the ref in COM APIs “No PIAs’ Feature  ◦ Ability to compile your application so that it does not require the Primary Interop Assemblies. ◦ Instead a small portion of the PIA required is put directly into the program’s assembly
  26. 26. What’s new in c# 4.0 – Variance Variance is one of those things most of us don’t  often don’t have to think about There are some cases which you may assume  should work that don’t however.
  27. 27. What’s new in c# 4.0 – Variance The following example does not work even though  string obviously inherits from object If it did, the following would have to work, which  goes against type safety
  28. 28. What’s new in c# 4.0 – Variance There may however be times where you would  want to have this type of thing happening and for it to happen safely c# 4.0 allows for covariance and contravariance  through the new out and in keywords
  29. 29. What’s new in c# 4.0 – Covariance and Contravariance Demo
  30. 30. Conclusion A lot of great new technologies and tools coming  out very soon There are some key advancements in both c# and  .net 4.0, so we should all be looking to familiarise ourselves with them and take advantage when they are available Download VS 2010 CTP and go through the  Walkthroughs
  31. 31. References http://www.microsoft.com/visualstudio/en-  us/products/2010/default.mspx ◦ Visual Studio 2010 main site and CTP download ◦ CTP is in the form of a VHD and some software expired on it in January 2009. There are workarounds. http://channel9.msdn.com/pdc2008/TL26/  ◦ Parallel Programming for Managed Developers with Visual Studio 2010 http://patramadass.emediait.com  ◦ This presentation, example code
  32. 32. Questions?

×