Always up-to-d8!

What's new in Umbraco C# 8?

zajkowskimarcin

mzajkowski

zajkowskimarcin

Question 1/64

Who already installed
Visual Studio 2019 (or used it in the Preview)?

Question 2/64

Who is regularly using C# 7 features?

If it's there - use it.

If you can't use the latest C# Umbraco at work, do it at least at home!
(unless you're working from home...)

public class GoldenThought1 : ITweetable {
}

C# history in a nutshell

  • C# 3 - LINQ FTW!
  • C# 4 - Dynamics FTW!
  • C# 5 - Async FTW!
  • C# 6 - ???
    • Roslyn (compiler-as-a-service)
    • Exception fillters
    • Auto property initializers & default values for getter-only properties
    • Expression-bodied members
    • Null propagator
    • String interpolation
    • nameof
  • C# 7 - ???
    • Out variables
    • Pattern Matching FTW!
    • Tuples
    • Local functions
    • Ref, ref, ref... (returns, locals)
    • Expression-bodied constructors, finalizers, getters and setters
  • C# 8 - ???

C# FTW!

C# 7.1

14th August 2017
Visual Studio 2017 Update 3 (version 15.3)

https://github.com/dotnet/csharplang

https://github.com/dotnet (Roslyn, corefx, corecrl and more..)

Contribute!

Gotchas!

C# 8.x with Umbraco?



Nah, not yet...

Works only in
VS 2019 Preview

(for now - why??)

What's next?!

Default Interface Members

MySweetClassWhichIDontWantToModify myClass = 
    new MySweetClassWhichIDontWantToModify();

// Won't work because FireAllDevs() is private
myClass.FireAllDevs(); 

ICanHasDefaultMembers myClassOnSteroids = 
    (ICanHasDefaultMembers)myClass;

myClassOnSteroids.FireAllDevs(); // It works!

Implicitly Typed

new-expressions

Where to look for more

Marcin Zajkowski

Umbraco MVP, Trainer & Certified Master @ The Cogworks

 

 

 

CTO / CKO @ WOW School

Marcin @ umbraCoffee (Friday's 12:30 on YT)

Blogger @ udfnd.pl

zajkowskimarcin

mzajkowski

zajkowskimarcin

socialmediaforbusyprogrammers.com

Thank you!

@zajkowskimarcin  /  marcin.zajkowski@thecogworks.com

Questions? Afterparty!