SlideShare a Scribd company logo
C# 6 Peek into the future
How to Simplify and Clarify your code
Tome Tomovski
Introduction
• Author
– Microsoft Certified Trainer, Engineer, Consultant
– Main fields: Banking, Telecommunication,
Oil & Gas and Industrial IT
•
Is it a revolution?
• C# 2.0 and 3.0 (.NET 2.0/3.5)
• Introduction to generics and way to program collections with LINQ
• C# 4.0 (.NET 4.0)
• Named and Optional Parameters, Dynamic support, COM Interop
• C# 5.0 (.NET 4.5)
• Simplification of asynchronous programming patterns
• C# 6.0 (.NET 4.6/5)
• Simply changes the way we write C# code
Peek into C# 6.0 Features
• Auto property initialization
• Dictionary initialization
• String interpolation ($ sign)
• Using Static syntax
• nameof method
• Exception filters
• Lambda expression debugging
• Async / await in error handling
• Null conditional operator
New Features
Configure Build for language version
Auto Property Initialization
• Before:
• If we had to provide default value for properties => initialize the
properties in the constructor of that class.
• Now:
– Auto property initializer
public class Student
{
///
/// Default constructor to initialize
/// properties
public Student1()
{
this.Id = 1;
this.Name = "John";
this.Grade = "A++";
this.JoiningDate = DateTime.Now.Date;
}
public int Id { get; set; }
public string Name { get; set; }
public string Grade { get; set; }
public DateTime JoiningDate { get; set; }
}
Dictionary Initialization
• Before:
• Initializing Dictionary collection with double curly braces
• Confusing for most C# developers
• Now:
– New format which is much easier to read
String Interpolation ($ sign)
• Before:
• Used placeholder {0}, {1}, and then replacing these placeholder values
with actual values
• Now:
– Directly user variable or even expression instead of using placeholders
Using static syntax
• Before:
• Had to put qualifying type name before accessing the static member
• Now:
– Import all static member of type (class)
nameof Method
• Before:
• … not existent
• Now:
– To return the name of any program element
– When we want to use the name of any programming element to raise
an event that uses name of some element.
Exception filter
• Now:
– Enable conditional execution of catch block
– Different catch block for each specific condition
Async / await in error handling
• Now:
– Await functionality in error handling
– If any operation performs operation
in try block then catch and finally
block wait for the operation to be
completed and then we may
perform asynchronous operation in
catch and finally block.
– Ex: Log exceptions in a DB without
blocking the current thread.
Lambda expression debugging
• Now:
– Still under development
– Expression debugging when working with LINQ and lambda
expressions
– Native functions as LINQ-to-SQL still not supported
Universal Windows apps
Debugging and Diagnostics
• PerfTips
• Display the execution time of methods during debugging
• Quickly spot bottlenecks
• Error List
– Supports filtering on any column
– Live view of errors, warnings and code analysis
• GPU Usage Tool
– Helps to troubleshoot whether performance bottlenecks are
originating in the CPU or GPU.
Live code analysis (light bulbs)
• New C# compiler
• Rich and customizable feedback and suggestions directly inside
the code editor as you type.
Blend in and rock
• Blend for Visual Studio 2015 comes with several enhancements:
•
•
•
•
•
•
Application Insights
•
•
Code understanding
•
•
•
Code understanding
•
•
•
C-Sharp 6.0 ver2

More Related Content

What's hot

The Java Story
The Java StoryThe Java Story
The Java Story
David Parsons
 
JavaCro'19 - The State of Java and Software Development in Croatia - Communit...
JavaCro'19 - The State of Java and Software Development in Croatia - Communit...JavaCro'19 - The State of Java and Software Development in Croatia - Communit...
JavaCro'19 - The State of Java and Software Development in Croatia - Communit...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
ATDD Using Robot Framework
ATDD Using Robot FrameworkATDD Using Robot Framework
ATDD Using Robot Framework
Pekka Klärck
 
Java architecture
Java architectureJava architecture
Java architecture
Rakesh Vadnala
 
Java byte code presentation
Java byte code presentationJava byte code presentation
Java byte code presentation
Mahnoor Hashmi
 
Java virtual machine
Java virtual machineJava virtual machine
Java virtual machine
Nikhil Sharma
 
Architecture diagram of jvm
Architecture diagram of jvmArchitecture diagram of jvm
Architecture diagram of jvm
home
 
Functions
FunctionsFunctions
Functions
Ans Rajput
 
Modern Programming Languages - An overview
Modern Programming Languages - An overviewModern Programming Languages - An overview
Modern Programming Languages - An overview
Ayman Mahfouz
 
Network Protocol Testing Using Robot Framework
Network Protocol Testing Using Robot FrameworkNetwork Protocol Testing Using Robot Framework
Network Protocol Testing Using Robot Framework
Payal Jain
 
Functional programming with Java 8
Functional programming with Java 8Functional programming with Java 8
Functional programming with Java 8
Talha Ocakçı
 
Java-java virtual machine
Java-java virtual machineJava-java virtual machine
Java-java virtual machine
Surbhi Panhalkar
 
Reviewing CPAN modules
Reviewing CPAN modulesReviewing CPAN modules
Reviewing CPAN modules
neilbowers
 
Java introduction
Java introductionJava introduction
Java introduction
logeswarisaravanan
 
Erlang workshopdrammen
Erlang workshopdrammenErlang workshopdrammen
Erlang workshopdrammen
Reidar Sollid
 
History of java'
History of java'History of java'
History of java'
deepthisujithra
 
Java Virtual Machine - Internal Architecture
Java Virtual Machine - Internal ArchitectureJava Virtual Machine - Internal Architecture
Java Virtual Machine - Internal Architecture
subnesh
 
Chapter 1.3
Chapter 1.3Chapter 1.3
Chapter 1.3
sotlsoc
 
Functional programming with Xtend
Functional programming with XtendFunctional programming with Xtend
Functional programming with Xtend
Sven Efftinge
 
QSpiders - Memory (JVM architecture)
QSpiders - Memory (JVM architecture)QSpiders - Memory (JVM architecture)
QSpiders - Memory (JVM architecture)
Qspiders - Software Testing Training Institute
 

What's hot (20)

The Java Story
The Java StoryThe Java Story
The Java Story
 
JavaCro'19 - The State of Java and Software Development in Croatia - Communit...
JavaCro'19 - The State of Java and Software Development in Croatia - Communit...JavaCro'19 - The State of Java and Software Development in Croatia - Communit...
JavaCro'19 - The State of Java and Software Development in Croatia - Communit...
 
ATDD Using Robot Framework
ATDD Using Robot FrameworkATDD Using Robot Framework
ATDD Using Robot Framework
 
Java architecture
Java architectureJava architecture
Java architecture
 
Java byte code presentation
Java byte code presentationJava byte code presentation
Java byte code presentation
 
Java virtual machine
Java virtual machineJava virtual machine
Java virtual machine
 
Architecture diagram of jvm
Architecture diagram of jvmArchitecture diagram of jvm
Architecture diagram of jvm
 
Functions
FunctionsFunctions
Functions
 
Modern Programming Languages - An overview
Modern Programming Languages - An overviewModern Programming Languages - An overview
Modern Programming Languages - An overview
 
Network Protocol Testing Using Robot Framework
Network Protocol Testing Using Robot FrameworkNetwork Protocol Testing Using Robot Framework
Network Protocol Testing Using Robot Framework
 
Functional programming with Java 8
Functional programming with Java 8Functional programming with Java 8
Functional programming with Java 8
 
Java-java virtual machine
Java-java virtual machineJava-java virtual machine
Java-java virtual machine
 
Reviewing CPAN modules
Reviewing CPAN modulesReviewing CPAN modules
Reviewing CPAN modules
 
Java introduction
Java introductionJava introduction
Java introduction
 
Erlang workshopdrammen
Erlang workshopdrammenErlang workshopdrammen
Erlang workshopdrammen
 
History of java'
History of java'History of java'
History of java'
 
Java Virtual Machine - Internal Architecture
Java Virtual Machine - Internal ArchitectureJava Virtual Machine - Internal Architecture
Java Virtual Machine - Internal Architecture
 
Chapter 1.3
Chapter 1.3Chapter 1.3
Chapter 1.3
 
Functional programming with Xtend
Functional programming with XtendFunctional programming with Xtend
Functional programming with Xtend
 
QSpiders - Memory (JVM architecture)
QSpiders - Memory (JVM architecture)QSpiders - Memory (JVM architecture)
QSpiders - Memory (JVM architecture)
 

Viewers also liked

El valor del respeto o salud mental y
El valor del respeto o salud mental yEl valor del respeto o salud mental y
El valor del respeto o salud mental y
RicharMedina43
 
MKT9780 Final Presentation _ IDenim
MKT9780 Final Presentation _ IDenimMKT9780 Final Presentation _ IDenim
MKT9780 Final Presentation _ IDenim
Mujia Liu
 
1776 Regulatory Hacking
1776 Regulatory Hacking1776 Regulatory Hacking
1776 Regulatory Hacking
Clare Bennett
 
Zigsaw
ZigsawZigsaw
Zigsaw
skh123ty
 
Article review 2
Article review 2Article review 2
Article review 2
bjai7903
 
Cityof ember
Cityof ember Cityof ember
Cityof ember
vanessanguyen02
 
Lanier
LanierLanier
Advertising Strategy for Levi's
Advertising Strategy for Levi's Advertising Strategy for Levi's
Advertising Strategy for Levi's
Mujia Liu
 
SharePoint WCM 2013
SharePoint WCM 2013SharePoint WCM 2013
SharePoint WCM 2013
Tome Tomovski
 
Revised article review 2
Revised article review 2Revised article review 2
Revised article review 2
bjai7903
 

Viewers also liked (10)

El valor del respeto o salud mental y
El valor del respeto o salud mental yEl valor del respeto o salud mental y
El valor del respeto o salud mental y
 
MKT9780 Final Presentation _ IDenim
MKT9780 Final Presentation _ IDenimMKT9780 Final Presentation _ IDenim
MKT9780 Final Presentation _ IDenim
 
1776 Regulatory Hacking
1776 Regulatory Hacking1776 Regulatory Hacking
1776 Regulatory Hacking
 
Zigsaw
ZigsawZigsaw
Zigsaw
 
Article review 2
Article review 2Article review 2
Article review 2
 
Cityof ember
Cityof ember Cityof ember
Cityof ember
 
Lanier
LanierLanier
Lanier
 
Advertising Strategy for Levi's
Advertising Strategy for Levi's Advertising Strategy for Levi's
Advertising Strategy for Levi's
 
SharePoint WCM 2013
SharePoint WCM 2013SharePoint WCM 2013
SharePoint WCM 2013
 
Revised article review 2
Revised article review 2Revised article review 2
Revised article review 2
 

Similar to C-Sharp 6.0 ver2

Compiler Construction
Compiler ConstructionCompiler Construction
Compiler Construction
Ahmed Raza
 
Design Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesDesign Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best Practices
Inductive Automation
 
Design Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesDesign Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best Practices
Inductive Automation
 
12 Step Guide to Lotuscript
12 Step Guide to Lotuscript12 Step Guide to Lotuscript
12 Step Guide to Lotuscript
Bill Buchan
 
Objective-c for Java Developers
Objective-c for Java DevelopersObjective-c for Java Developers
Objective-c for Java Developers
Muhammad Abdullah
 
Be armed to the teeth to maintain a high quality iOS code
Be armed to the teeth to maintain a high quality iOS codeBe armed to the teeth to maintain a high quality iOS code
Be armed to the teeth to maintain a high quality iOS code
Anastasia Kazakova
 
Binding Objective-C Libraries, Miguel de Icaza
Binding Objective-C Libraries, Miguel de IcazaBinding Objective-C Libraries, Miguel de Icaza
Binding Objective-C Libraries, Miguel de Icaza
Xamarin
 
Angular2
Angular2Angular2
Web technologies-course 07.pptx
Web technologies-course 07.pptxWeb technologies-course 07.pptx
Web technologies-course 07.pptx
Stefan Oprea
 
2R-3KS03-OOP_UNIT-I (Part-A)_2023-24.pptx
2R-3KS03-OOP_UNIT-I (Part-A)_2023-24.pptx2R-3KS03-OOP_UNIT-I (Part-A)_2023-24.pptx
2R-3KS03-OOP_UNIT-I (Part-A)_2023-24.pptx
GauravGamer2
 
C# Fundamental
C# FundamentalC# Fundamental
C# Fundamental
Thilini munasinghe
 
Road to sbt 1.0 paved with server
Road to sbt 1.0   paved with serverRoad to sbt 1.0   paved with server
Road to sbt 1.0 paved with server
Eugene Yokota
 
C language
C languageC language
C language
Arafat Bin Reza
 
Angular4 kickstart
Angular4 kickstartAngular4 kickstart
Angular4 kickstart
Foyzul Karim
 
Effective C++
Effective C++Effective C++
Effective C++
Andrey Karpov
 
Scala Days NYC 2016
Scala Days NYC 2016Scala Days NYC 2016
Scala Days NYC 2016
Martin Odersky
 
C_Programming_Notes_ICE
C_Programming_Notes_ICEC_Programming_Notes_ICE
C_Programming_Notes_ICE
Gilbert NZABONITEGEKA
 
c programming L-1.pdf43333333544444444444444444444
c programming L-1.pdf43333333544444444444444444444c programming L-1.pdf43333333544444444444444444444
c programming L-1.pdf43333333544444444444444444444
PurvaShyama
 
Unit 1.pptx
Unit 1.pptxUnit 1.pptx
Unit 1.pptx
NISHASOMSCS113
 
Prog1-L1.pdf
Prog1-L1.pdfProg1-L1.pdf
Prog1-L1.pdf
valerie5142000
 

Similar to C-Sharp 6.0 ver2 (20)

Compiler Construction
Compiler ConstructionCompiler Construction
Compiler Construction
 
Design Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesDesign Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best Practices
 
Design Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesDesign Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best Practices
 
12 Step Guide to Lotuscript
12 Step Guide to Lotuscript12 Step Guide to Lotuscript
12 Step Guide to Lotuscript
 
Objective-c for Java Developers
Objective-c for Java DevelopersObjective-c for Java Developers
Objective-c for Java Developers
 
Be armed to the teeth to maintain a high quality iOS code
Be armed to the teeth to maintain a high quality iOS codeBe armed to the teeth to maintain a high quality iOS code
Be armed to the teeth to maintain a high quality iOS code
 
Binding Objective-C Libraries, Miguel de Icaza
Binding Objective-C Libraries, Miguel de IcazaBinding Objective-C Libraries, Miguel de Icaza
Binding Objective-C Libraries, Miguel de Icaza
 
Angular2
Angular2Angular2
Angular2
 
Web technologies-course 07.pptx
Web technologies-course 07.pptxWeb technologies-course 07.pptx
Web technologies-course 07.pptx
 
2R-3KS03-OOP_UNIT-I (Part-A)_2023-24.pptx
2R-3KS03-OOP_UNIT-I (Part-A)_2023-24.pptx2R-3KS03-OOP_UNIT-I (Part-A)_2023-24.pptx
2R-3KS03-OOP_UNIT-I (Part-A)_2023-24.pptx
 
C# Fundamental
C# FundamentalC# Fundamental
C# Fundamental
 
Road to sbt 1.0 paved with server
Road to sbt 1.0   paved with serverRoad to sbt 1.0   paved with server
Road to sbt 1.0 paved with server
 
C language
C languageC language
C language
 
Angular4 kickstart
Angular4 kickstartAngular4 kickstart
Angular4 kickstart
 
Effective C++
Effective C++Effective C++
Effective C++
 
Scala Days NYC 2016
Scala Days NYC 2016Scala Days NYC 2016
Scala Days NYC 2016
 
C_Programming_Notes_ICE
C_Programming_Notes_ICEC_Programming_Notes_ICE
C_Programming_Notes_ICE
 
c programming L-1.pdf43333333544444444444444444444
c programming L-1.pdf43333333544444444444444444444c programming L-1.pdf43333333544444444444444444444
c programming L-1.pdf43333333544444444444444444444
 
Unit 1.pptx
Unit 1.pptxUnit 1.pptx
Unit 1.pptx
 
Prog1-L1.pdf
Prog1-L1.pdfProg1-L1.pdf
Prog1-L1.pdf
 

C-Sharp 6.0 ver2

  • 1. C# 6 Peek into the future How to Simplify and Clarify your code Tome Tomovski
  • 2. Introduction • Author – Microsoft Certified Trainer, Engineer, Consultant – Main fields: Banking, Telecommunication, Oil & Gas and Industrial IT •
  • 3. Is it a revolution? • C# 2.0 and 3.0 (.NET 2.0/3.5) • Introduction to generics and way to program collections with LINQ • C# 4.0 (.NET 4.0) • Named and Optional Parameters, Dynamic support, COM Interop • C# 5.0 (.NET 4.5) • Simplification of asynchronous programming patterns • C# 6.0 (.NET 4.6/5) • Simply changes the way we write C# code
  • 4. Peek into C# 6.0 Features
  • 5. • Auto property initialization • Dictionary initialization • String interpolation ($ sign) • Using Static syntax • nameof method • Exception filters • Lambda expression debugging • Async / await in error handling • Null conditional operator New Features
  • 6. Configure Build for language version
  • 7. Auto Property Initialization • Before: • If we had to provide default value for properties => initialize the properties in the constructor of that class. • Now: – Auto property initializer public class Student { /// /// Default constructor to initialize /// properties public Student1() { this.Id = 1; this.Name = "John"; this.Grade = "A++"; this.JoiningDate = DateTime.Now.Date; } public int Id { get; set; } public string Name { get; set; } public string Grade { get; set; } public DateTime JoiningDate { get; set; } }
  • 8. Dictionary Initialization • Before: • Initializing Dictionary collection with double curly braces • Confusing for most C# developers • Now: – New format which is much easier to read
  • 9. String Interpolation ($ sign) • Before: • Used placeholder {0}, {1}, and then replacing these placeholder values with actual values • Now: – Directly user variable or even expression instead of using placeholders
  • 10. Using static syntax • Before: • Had to put qualifying type name before accessing the static member • Now: – Import all static member of type (class)
  • 11. nameof Method • Before: • … not existent • Now: – To return the name of any program element – When we want to use the name of any programming element to raise an event that uses name of some element.
  • 12. Exception filter • Now: – Enable conditional execution of catch block – Different catch block for each specific condition
  • 13. Async / await in error handling • Now: – Await functionality in error handling – If any operation performs operation in try block then catch and finally block wait for the operation to be completed and then we may perform asynchronous operation in catch and finally block. – Ex: Log exceptions in a DB without blocking the current thread.
  • 14. Lambda expression debugging • Now: – Still under development – Expression debugging when working with LINQ and lambda expressions – Native functions as LINQ-to-SQL still not supported
  • 16. Debugging and Diagnostics • PerfTips • Display the execution time of methods during debugging • Quickly spot bottlenecks • Error List – Supports filtering on any column – Live view of errors, warnings and code analysis • GPU Usage Tool – Helps to troubleshoot whether performance bottlenecks are originating in the CPU or GPU.
  • 17. Live code analysis (light bulbs) • New C# compiler • Rich and customizable feedback and suggestions directly inside the code editor as you type.
  • 18. Blend in and rock • Blend for Visual Studio 2015 comes with several enhancements: • • • • • •