What's New in C# 6 and Visual Basic 14

Download this episode

Download Video

Download captions

Download Captions

Description

C# 6 and Visual Basic 14 both add a number of bite-sized new features, all aimed at making your everyday code cleaner and clearer. Instead of introducing new concepts, each feature makes a common coding pattern simpler, and removes boilerplate to let the intent of the code stand out. In this talk we'll walk you through all of these language features: interpolated strings, a nameof operator, an operator called Elvis and many more.

For more information, check out this course on Microsoft Virtual Academy:

Tags:

.NET, C#

Day:

3

Session Type:

Breakout

Code:

3-711

Room:

Hall 1A

Embed

Format

Available formats for this video:

Actual format may change based on video formats available and browser capability.

    The Discussion

    • User profile image
      Zhou Bing

      我手上正在使用1020,我很期待WIN10的到来,将来打算入手微软办公平板电脑

    • User profile image
      zwj

      Happy e

    • User profile image
      Andre Silva

      Can an app targeted for older versions of the .NET Framework take advantage of the new features in C# 6/VB 14 (like the nameof operator or the elvis operator)?

    • User profile image
      erickorlando

      I'm realy excited! I love programming [H]

    • User profile image
      dcampbell

      @Andre Silva -- yes!

    • User profile image
      Jeff

      Slide is broken, cannot open.

    • User profile image
      AdamMarks2

      I also cannot open these slides using the Win10 Powerpoint UWP

    • User profile image
      7bitex

      The slide is broken

    • User profile image
      Mads​Torgersen

      @Jeff, @AdamMarks2, @7bitex,

      You are right, the slides are broken. I've started to ask around to see if we can get it fixed.

      The "good" news is that there isn't a lot in the slides. Almost the whole session is demo. The only slides with anything interesting in them occur before we start demoing, in the first few minutes of the talk, so you can just watch a few minutes of the video to see them.

      I'll post back here if/when I learn that the slides are fixed.

    • User profile image
      Andre Silva

      Why won't VB get Await in Catch/Finally clauses and expression-bodied members in this release? Especially Await in Catch/Finally, which seems to be only code-related (no design issues). Is implementing Await in Catch/Finally that more difficult or time-demanding in VB than it is in C#?
      Also, can we expect this gap between VB and C# to keep widening in the future?
      I would be happy to see a blog on the future of VB from Microsoft. VB has been left out from a lot of things recently, and that makes me wonder if it's still worth investing on it. I'm already trying to move my main business to C#, but it would be nice to know for sure if I should do that asap or if I still have more time.

    • User profile image
      Johnny

      The slide is not able to open.

    • User profile image
      Mads​Torgersen

      The slides have now been updated, and they seem to work, at least for me.

    • User profile image
      Mads​Torgersen

      @Andre,

      We implemented await in catch and finally for C# first. It was exceedingly complicated, and the truth is we ran out of time to do it with high confidence in VB, just as some features also had to be dropped from C# at the last minute for lack of runway to do it well. I expect us to want to do it in the next version of VB.

      For the record, a lot of the VB 14 features actually reduce the gap between VB and C#. Please check out the feature list on GitHub. Many of the new VB features were already in C#.

      Whether to stay with VB or move to C# is ultimately a business decision you'll have to make based on the sum of factors affecting your specific situation. I can say that the value added to VB in VS 2015 is simply astounding: Lots of new language features, completely revamped IDE with refactorings, Roslyn analyzers and fixes, greatly improved debugging, etc., etc. From the core language experience point of view, this is the biggest renewal of VB in a long time.

    • User profile image
      ljw1004

      @Andre, just to note, lack of await in catch/finally has a very easy workaround. For instance, instead of

      Try
          stuff1
      Catch ex As Exception
          stuff2
          Await r.CloseAsync()
      End Try

      you can instead write

      Dim t As Task = Nothing
      Try
          stuff1
      Catch ex As Exception
          stuff2
          t = r.CloseAsync()
      End Try
      If t IsNot Nothing Then Await t

       

    • User profile image
      Andre Silva

      @MadsTorgersen @ljw1004 Thanks a lot for the replies. And I knew about the workarounds, it's just that after seeing VB being left out from some things recently, I feared (and I still do! :p) for its future.

    • User profile image
      simin

      harap di normalkan kembali

    Comments closed

    Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.