Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Latest commit

 

History

History
360 lines (345 loc) · 75.1 KB

README.md

File metadata and controls

360 lines (345 loc) · 75.1 KB

C# reference

Concepts

The C# concept exercises are based on concepts. The list below contains the concepts that have been identified by the track maintainers for the C# language.

(Please do not modify this document. it is automatically generated. All text except the concept learning objectives is sourced from exercises.json which should be updated manually when a concept is added, an "new exercise" issue is raised or the exercise is completed and merged into master. Learning objectives are scraped from the concept definition text in each exercise's design.md document and should be modified there as required.)

This report is updated automatically when any design.md document is modified or csharp/reference/README.md is edited.

Introductory Concepts

Essential Concepts

  • anonymous-types (anonymous-types)
  • async (async)
  • attributes-advanced (attributes-advanced) - Issue
  • collections-combining (linq)
  • collections-filtering (linq)
  • collections-mapping (linq)
  • collections-ordering (linq)
  • collections-reducing (linq)
  • contravariance (contravariance)
  • covariance (covariance)
  • delegates (delegates)
  • enumerables (enumerables)
  • events (events)
  • extension-methods (extension-methods) - Issue
  • generics-advanced (generics-advanced)
  • higher-order-functions (higher-order-functions) - Background
  • indexers (indexers)
  • lambdas (lambdas) - Background
  • linq (linq) - Background
  • linq-advanced (linq-advanced)
  • linq-query-syntax (linq-query-syntax)
  • linq-select-many (linq-select-many)
  • locks (locks)
  • pattern-matching-tuples (pattern-matching-tuples) - Issue
  • pattern-matching-types (pattern-matching-types) - Issue
  • recursion (recursion) - Background
  • reflection (reflection)
  • serialization (serialization)
  • statics (statics)
  • streams (streams)
  • tasks (tasks)
  • thread-safety (thread-safety)
  • yield (yield)

Advanced Concepts

  • aysnc-iterators (aysnc-iterators)
  • boxing (boxing)
  • by-ref (by-ref)
  • destructors (destructors)
  • dispose-pattern (dispose-pattern)
  • dynamic (dynamic)
  • immutability (immutability) - Background
  • immutable-collections (immutable-collections)
  • lazy (lazy)
  • local-functions (local-functions) - Background
  • memory-allocation (memory-allocation) - Issue
  • multi-dimensional-array (multi-dimensional-array)
  • pointsers (pointers) - Issue
  • queues (queues) - Background
  • ranges (ranges) - Background
  • ref-local (ref-local)
  • resource-pooling (resource-pooling) - Issue
  • slicing (slicing)
  • stacks (stacks) - Background
  • time-zones (time-zones)
  • unsafe-code (unsafe-code)

Unallocated Concepts

  • formatting-types (unallocated-concepts)

Learning Objectives

Concept Learning Objectives
arrays
  • know of the existence of the Array type
  • know how to define an array
  • know how to access elements in an array by index
  • know how to update an element in an array by index
  • know how to iterate over elements in an array
  • know of some basic functions (like finding the index of an element in an array).
assignment
  • know the syntax and behavior of assignment in OO languages
base-class-library
  • know of the existence and role of the base class library
basics
  • know what a variable is
  • know how to define a variable
  • know how to update a variable
  • know how to use type inference for variables
  • know how to define a method
  • know how to return a value from a method
  • know how to call a method
  • know that methods must be defined in classes
  • know about the public access modifier
  • know about the static modifier
  • know how to define an integer
  • know how to use mathematical operators on integers
  • know how to define single- and multiline comments. The following sub-concepts are included type-inference, return-values, mutation, functions, comments, scoping, variables
booleans
  • know of the existence of the bool type and its two values
  • know about boolean operators and how to build logical expressions with them
  • know of the boolean operator precedence rules.
booleans
  • know of the existence of the bool type and its two values
  • know about boolean operators and how to build logical expressions with them
  • know of the boolean operator precedence rules.
casting
  • know what explicit and implicit casts are
  • know how to do an explicit cast
  • know how to use is and as to convert between types.
chars
  • know of the existence of the char type
  • know that a char represents
  • know how to define a char
  • know how to access a char in a string by index
  • know of some basic char methods (like converting to uppercase).
classes
  • know what classes are
  • know what encapsulation is
  • know what fields are
  • know how to create an object
  • know how to update state through methods
  • know about the void type.
collections
  • know the role of collections in OO languages
constants
  • know how to define const values
  • know how to define readonly modifier know when to use const or readonly.
constructors
  • know what constructors are
  • know how to define parameterless constructors
  • know how to define parameterized constructors
  • know how to use constructor overloading
  • know how to define private constructors.
cross-platform
  • know how to have different code paths (selected at run-time) for Linux, Windows and Mac
datetimes
  • know how to create a DateTime instance
  • know how to get the current date
  • know of the individual, date-related properties
  • know how to access the current date
  • know how to compare dates
  • know how to convert a string to a DateTime and vice versa
  • know of the existence of the DateTime type
  • know of the individual, time-related properties.
defensive-copying
  • know how and when to use defensive copying
dictionaries
  • know of the existence of the Dictionary<TKey, TElement> type
  • know how to define a dictionary
  • know how to add and updated elements in a dictionary
  • know how to access elements in a dictionary by key
  • know how to iterate over elements in a dictionary
  • know some basic dictionary functions.
do-while-loops
  • know the syntax of do loop
  • know when to use a do loop
enums
  • know of the existence of the enum keyword
  • know how to define enum members
  • know how to assign values to enum members
  • know how to get an enum's numeric value
  • know how to convert an enum to a string.
equality
  • know how to check for equality and inequality
  • know how reference equality differs from structural equality
  • know that equality works by default for value and reference types
  • know how to customize equality checks using Equals and GetHashCode()
  • know of the IEquatable<T> and IEqualityComparer<T> interfaces and how to implement them.
exception-filtering
  • know how to use exception filtering.
exceptions
  • know what exceptions are
  • know when an exception should be thrown
  • know how to throw (and rethrow) an exception
  • know how to catch an exception
  • know the most important built-in exceptions (ArgumentException, InvalidOperationException).
explicit-interfaces
  • know how an explicit interface is declared
  • know how use an explicit interface
  • know why explicit interfaces are useful
expression-bodied-members
  • know the difference between statements and expressions
  • know how to define expression bodied members.
flag-enums
  • know how to define a "flags" enum
  • know how to add, remove or check for flags
  • know how to change the underlying type of an enum.
floating-point-numbers
  • know of the existing of the three floating point types: double, float and decimal. know when to use which floating point type.
for-loops
  • know how to use a for loop to do iteration.
foreach-loops
  • know how to iterate over a collection.
generic-types
  • know what generic types are.
if-statements
  • know how to conditionally execute code using an if statement.
implicit-casting
  • know about implicit type conversion
imports
  • know how to import namespaces with the using directive
inheritance
  • know what inheritance is
  • know how to inherit from a class
  • know that all types inherit from object
  • know what abstract and sealed classes are
  • know what abstract and virtual methods are
  • know how to override methods
  • know about the protected visibility modifier.
integral-numbers
  • know of the difference between signed and unsigned integral types
  • know of the existence of the integral types: sbyte, byte, short, ushort, int, uint, long and ulong
  • know when to use which integral type.
interfaces
  • know what interfaces are
  • know how to use interfaces
  • know how to define an interface
  • know how to implement an interface
  • know how to explicitly implement an interface.
interpolation
  • know how the syntax of interpolated strings
  • know when to use string interpolation
lists
  • know of the existence of the List<T> type
  • know how a list is different from an array
  • know how to define a list
  • know how to add and remove elements from a list
  • know how to access elements in a list by their index
  • know how to iterate over elements in a list
  • know some basic list functions (like finding the index of an element in a list).
marker-interfaces
  • know what a marker interface is
  • know of some common marker interfaces
math-operators
  • know the math operators
  • know about precedence
  • know the role of parentheses
method-overloading
  • know what method overloading is
  • know how to define overloaded methods
  • know the limitations of method overloading
named-arguments
  • know how to use named arguments
namespaces
  • know what namespaces are
  • know how to import namespaces.
nested-types
  • know syntax for nested classes
  • know when to use nested classes
  • familiarity with other nested types such as structs and enums
null-coalescing
  • know the syntax and behavior of the null-coalescing operator (??)
null-conditional
  • know the syntax and behavior of the null-conditional operator (?.)
null-forgiving
  • know the syntax and behavior of the null-forgiving operator (!.)
  • know to use the operator with discretion
nullability
  • know of the existence of the null literal
  • know what a NullReferenceException is and when it is thrown
  • know how to compare a value to null
  • know the difference between value and reference types regarding nullability
  • know how to define nullable reference and value types
  • know about the null-related operators
  • know about basic null checking by the compiler.
nullable-values
  • know about nullable primitives
  • know about nullable structs
numbers
  • know of the existence of the two most commonly used number types, int and double
  • understand that the former represents whole numbers, and the latter floating-point numbers
  • know of basic operators such as multiplication, comparison and equality
  • know how to convert from one numeric type to another
  • know what implicit and explicit conversions are.
numbers
  • know of the existence of the two most commonly used number types, int and double
  • understand that the former represents whole numbers, and the latter floating-point numbers
  • know of basic operators such as multiplication, comparison and equality
  • know how to convert from one numeric type to another
  • know what implicit and explicit conversions are.
object-initializers
  • Know how to initialize objects using object initialization syntax. Know how to initialize lists and dictionaries. Understand the relative advantages of constructors and initializers.
operator-overloading
  • know when to how and why to overload operators for your own classes
  • understand the syntax of equality, comparison and arithmetic operators
  • know the syntax of user defined type conversion
  • know which operators cannot be overloaded
optional-arguments
  • know the syntax and behavior or optional arguments
optional-parameters
  • know how to define optional parameters
ordering
  • know how to implement the IComparable<T> interface and what its effect is on the behavior of collections.
out-parameters
  • know the syntax of out parameters
  • know the role of out parameters
overflow
  • explain integral number overflows
  • explain floating-point number overflows
  • know how to use checked and unchecked to deal with overflows.
parameters
  • know the difference between value and reference type parameters
  • know how to pass value types by reference using the ref and out modifiers.
properties
  • know what properties are and how they relate to fields and methods
  • know what backing-field properties are
  • know what auto-implemented properties are
  • know what calculated properties are
  • know how to use property accessors to customize visibility
  • know how to define the different types of properties.
randomness
  • know how to implement randomness with System.Random in C#
  • know that no seed is required
  • know that both integers and real numbers can be generated
  • know that once generated random numbers can be easily used for many purposes (including non-numeric ones)
readonly-collections
  • know how to make a collection read-only
  • understand the difference between the role of the readonly modifier and the use of readonly collections
regular-expressions
  • Know how to use regular expressions with Regex in C#
  • Know how to identify the presence of a pattern in a string
  • Know how to "capture" and replace text identified by patterns
  • Know how to use the Options property of Regex
  • Know that search performance can be enhanced by compiling Regex (discussion only)
resource-cleanup
  • Know how to clean up resources with IDisposable in C# and .NET. Understand the difference between managed and unmanaged resources and the role of IDisposable.
resource-lifetime
  • Know how to control a resource's lifetime with the using statement in C#
sets
  • Know how to use hash sets HashSet<T> as provided by the .NET BCL. Understand the relationship with Object.GetHashCode() and the performance characteristics of hash sets.
string-builder
  • know how to use a StringBuilder
  • know that it is more performant than simple concatenation
string-formatting
  • know how to use the ToString() method to convert any object to a string
  • know how to use string interpolation on values of any type
  • know how to use default format strings to convert to standard output formats
  • know how to use custom format strings to convert to custom output formats
  • know that string.Format underlies string interpolation
  • know that string interpolation can interpolate any expression.
strings
  • know of the existence of the string type
  • know of some basic functions (like looking up a character at a position, or slicing the string)
  • know how to do basic string formatting.
structs
  • know xx what structs are
  • know how to define a struct
  • know how to add members to structs
  • know the differences between structs and classes.
switch-expressions
  • know how to pattern match on values
  • know how to use when guards
switch-statements
  • Know how to use switch statements
ternary-operators
  • know how and when to use the ternary operator.
throw-expressions
  • know how to use a throw expression.
time
  • Know how to use DateTime when time-of-day is important. Understand the difference between local time and Universal Coordinated Time). Understand the role of CultureInfo in parsing times. Understand arithmetic with DateTimes.
timezone
  • Know about time zones and their ids. Be familiar with cross-platform issues. Know how to convert dates and times between time zones. Know how to detect daylight saving time.
tuples
  • know what a tuple is
  • know how to define a tuple
  • know how to name tuple fields
  • know that tuples have structural equality
  • know how to deconstruct tuples
  • know that tuples are mutable.
unsigned-integers
  • know the characteristics of unsigned integers
user-defined-exceptions
  • know how to define a user-defined exception.
verbatim-strings
  • the syntax of verbatim strings
while-loops
  • know how to write a while loop.