Modern C#

Please register here or let me know directly

Description

The course covers topics related to the modern C# language, which allows for creating solutions using object-oriented and functional approaches. The workshop’s goal is to present selected elements of functional programming and their connection to specific aspects of the C# language in the last few versions.

Duration: 3 days

Details

  • C# 2 / C# 3
    • Generic types, delegates, iterators
    • Extension methods, lambda Expressions, object/collection initializer, anonymous types, var
    • LINQ operators
  • C# 6
    • Default values for getter-only properties
    • Auto-property initializers
    • Expression-bodied members
    • Static imports
    • Exception filters
    • Null propagator
    • String interpolation
    • nameof operator
    • Index initializers
    • Await in catch/finally blocks
    • Add Extension Methods in Collection
  • C# 7
    • Out variables
    • Tuples and deconstruction
    • Pattern matching
    • Local functions
    • Expanded expression bodied members
    • Ref locals and returns
    • Discards
    • Binary Literals and Digit Separators
    • Throw expressions
  • C# 7.1, 7.2, 7.3
    • async Main method
    • default literal expressions
    • Inferred tuple element names
    • Pattern matching on generic type parameters
    • Options -refout and -refonly that control reference assembly generation.
    • Techniques for writing safe efficient code
    • Non-trailing named arguments
    • Leading underscores in numeric literals
    • “private protected” access modifier
    • Conditional “ref” expressions
  • C# 8
    • Readonly members
    • Default interface methods
    • Pattern matching enhancements
      • Switch expressions
        • Property patterns
        • Tuple patterns
        • Positional patterns
    • Using declarations
    • Static local functions
    • Disposable ref structs
    • Nullable reference types
    • Asynchronous streams
    • Indices and ranges
    • Null-coalescing assignment
    • Unmanaged constructed types
    • Stackalloc in nested expressions
    • Enhancement of interpolated verbatim strings
  • C# 9
    • Records
    • Init only setters
    • Top-level statements
    • Pattern matching enhancements
    • Performance and interop
    • Native sized integers
    • Function pointers
    • Suppress emitting localsinit flag
    • Fit and finish features
      • Target-typed new expressions
      • static anonymous functions
      • Target-typed conditional expressions
      • Covariant return types
      • Extension GetEnumerator support for foreach loops
      • Lambda discard parameters
      • Attributes on local functions
    • Support for code generators
      • Module initializers
      • New features for partial methods
  • C# 10
    • Record structs
    • Improvements of structure types
    • Interpolated string handlers
    • global using directives
    • File-scoped namespace declaration
    • Extended property patterns
    • Improvements on lambda expressions
    • Allow const interpolated strings
    • Record types can seal ToString()
    • Improved definite assignment
    • Allow both assignment and declaration in the same deconstruction
    • Allow AsyncMethodBuilder attribute on methods
    • CallerArgumentExpression attribute
    • Enhanced #line pragma
  • What’s new in C#11, C#12, …
  • Selected elements of functional programming
    • Function as value, closure, higher-order functions, function composition, partial function argument application, currying
    • Lazy evaluation, sequences
    • Imperative vs. Declarative programming
    • Object-oriented vs. functional code organization
    • Pattern matching
    • Algebraic data types (tuples, records, “sum types”)
    • Optionality, error handling
    • Invariance, side effects, pure functions