Code Mahek
  • Blog
  • About
  • Contact
  • Random Clicks
  • Resume
  • Ava Chat Bot

Fragrance
​of Programming

C# 8.0 Preview: First four feature

9/10/2017

Comments

 
 Recently in channel 9, Mads Torgersen demonstrated the first few features for C# 8. Below are the few features.
  • Nullable Reference Types
With C# 8.0, references type would not be nullable by default. Assigning null to a non-nullable reference type will be a compiler warning, similarly reading from a nullable type would be a compiler warning unless the variable in question was explicitly checked for null ahead of time.
  • Async Streams
Async streams are the asynchronous equivalent of IEnumerable. Syntax for the same is

  • Default Interface
A default interfaces programming capability, so interfaces can be evolve via virtual extension methods. An API author could add methods to an interface in future versions without breaking source or binary compatibility. The feature already is available in languages such as Java.
  • Extension Everything
Long-time pending feature was extension properties. Under the new design, there is a new top-level construct called an extension. Example if you want to create extension methods and properties for an Employee class you can write:

For more information you can refer C# Language Design Repo.
Comments
comments powered by Disqus

    RSS Feed

    Categories

    All
    Azure
    C#
    Cloud
    CodeProject
    CSharp
    DotNet Core
    Jetbrains
    .NET
    Rider
    Source Generators
    SQL
    Tech News
    Ubuntu
    Visual Studio 2015
    Visual Studio 2019
    Windows
    Windows 10

    Archives

    May 2020
    February 2019
    January 2019
    December 2018
    May 2018
    December 2017
    November 2017
    October 2017
    September 2017
    July 2017
    May 2017
    April 2017
    May 2015
    April 2015
    March 2015

    View my profile on LinkedIn

Location

Contact Us

    Subscribe Today!

Submit
  • Blog
  • About
  • Contact
  • Random Clicks
  • Resume
  • Ava Chat Bot