future directions for c and visual basic l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Future directions for C# and Visual Basic PowerPoint Presentation
Download Presentation
Future directions for C# and Visual Basic

Loading in 2 Seconds...

play fullscreen
1 / 23

Future directions for C# and Visual Basic - PowerPoint PPT Presentation


  • 221 Views
  • Uploaded on

TOOL-816T. Future directions for C# and Visual Basic. Anders Hejlsberg Technical Fellow Microsoft Corporation. Agenda. What’s new in C# 5.0 and VB 11.0? Asynchronous Metro style C#/VB applications Hybrid C#/VB and Javascript applications A look into the future: The Roslyn project.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Future directions for C# and Visual Basic' - ojal


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
future directions for c and visual basic
TOOL-816T

Future directions for C# and Visual Basic

Anders Hejlsberg

Technical Fellow

Microsoft Corporation

agenda
Agenda
  • What’s new in C# 5.0 and VB 11.0?
  • Asynchronous Metro style C#/VB applications
  • Hybrid C#/VB and Javascript applications
  • A look into the future: The Roslyn project
c and vb evolution
C# and VB evolution

C# 5.0 + VB 11.0

Windows Runtime + Asynchrony

C# 4.0 + VB 10.0

Dynamic + Language Parity

C# 3.0 + VB 9.0

Language Integrated Query

C# 2.0 + VB 8.0

Generics

C# 1.0 + VB 7.0

Managed Code

what s new
What’s new?

C# 5.0

VB 11.0

Windows Runtime support

Asynchronous programming

Caller info attributes

Iterators

  • Windows Runtime support
  • Asynchronous programming
  • Caller info attributes
asynchronous programming models
Asynchronous programming models
  • Windows Runtime: IAsyncOperation<T>
  • .NET Framework: Task<T>
  • Javascript: Promises
  • All are objects representing “ongoing operations”
  • All use callbacks to signal completion of operation
  • Challenge: Callbacks turn your code inside out
  • Insight: Automatic transformation to callbacks is possible
asynchronous methods
Asynchronous methods
  • publicasyncTask<XElement> GetXmlAsync(stringurl) {
  • varclient = newHttpClient();
  • varresponse = awaitclient.GetAsync(url);
  • vartext = response.Content.ReadAsString();
  • returnXElement.Parse(text);
  • }

publicTask<XElement> GetXmlAsync(stringurl) {

vartcs= newTaskCompletionSource<XElement>();

var client = newHttpClient();

client.GetAsync(url).ContinueWith(task => {

varresponse = task.Result;

vartext = response.Content.ReadAsString();

tcs.SetResult(XElement.Parse(text));

});

returntcs.Task;

}

asynchronous methods10
Asynchronous methods…
  • Are marked with new “async” modifier
  • Must return void or Task<T>
  • Use “await” operator to cooperatively yield control
  • Are resumed when awaited operation completes
  • Can await anything that implements the “awaiter pattern”
  • Execute in the synchronization context of their caller
  • Allow composition using regular programming constructs
  • Feel just like good old synchronous code!
caller info attributes
Caller Info attributes

__FILE__ and __LINE__macros in C#?

caller info attributes13
Caller Info attributes
  • publicstaticclassTrace
  • {
  • publicstaticvoidWriteLine(string message,
  • [CallerFilePath] string file = "",
  • [CallerLineNumber] int line = 0,
  • [CallerMemberName] string member = "")
  • {
  • var s = string.Format("{0}:{1} – {2}: {3}", file, line, member, message);
  • Console.WriteLine(s);
  • }
  • }

voidInitialize() {

Trace.WriteLine("Starting services");

...

}

Trace.WriteLine("Starting services", "c:\\sources\\foo.cs", 1123, "Initialize");

c and vb evolution14
C# and VB evolution

C# 5.0 + VB 11.0

Windows Runtime + Asynchrony

C# 4.0 + VB 10.0

Dynamic + Language Parity

C# 3.0 + VB 9.0

Language Integrated Query

C# 2.0 + VB 8.0

Generics

C# 1.0 + VB 7.0

Managed Code

the roslyn project
The Roslyn project

Meta-programming

Read-Eval-Print Loop

Class

public

Foo

Language

Object Model

Field

DSL Embedding

private

X

string

Compiler

Compiler

SourceFile

.NET Assembly

Source code

Source code

Source code

Source code

roslyn apis
Roslyn APIs

Edit and Continue

Signature Help

Extract Method

Find All References

Rename

Go To Definition

Quick Info

Navigate To

Object Browser

Formatter

Colorizer

Completion List

Outlining

Language Service

Compiler APIs

Syntax Tree API

Parser

Symbol API

Symbols

Binding and Flow Analysis APIs

Binder

Emit API

IL Emitter

Compiler Pipeline

Metadata Import

summary
Summary
  • C# and VB deeply support the Windows Runtime
  • C# and VB make asynchronous programming easy
  • You can create hybrid C#/VB and Javascript apps
  • Visual Studio Roslyn CTP will be available soon
for more information
For more information

RELATED SESSIONS

DOCUMENTATION & ARTICLES

  • [PLAT-203T] Async everywhere: creating responsive APIs & apps
  • [TOOL-531T] Using the Windows Runtime from C# and Visual Basic
  • [SAC-804T] Building IIS and ASP.NET apps with the power of async
  • [TOOL-810T] Async made simple in Windows 8, with C# and Visual Basic
  • [TOOL-829T] The zen of async: Best practices for best performance
  • Visual Studio Asynchronous Programmingwww.msdn.com/vstudio/async
  • What's New for Visual C# inVisual Studio 11 Developer Preview
  • http://go.microsoft.com/fwlink/?LinkId=228087
  • What's New for Visual Basic inVisual Studio 11 Developer Preview
  • http://go.microsoft.com/fwlink/?LinkId=228088
feedback and q uestions http forums dev windows com session f eedback http bldw in sessionfeedback
thank you

Feedback and questions http://forums.dev.windows.com

Session feedbackhttp://bldw.in/SessionFeedback

slide22

© 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.

The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.