historic version
As a Microsoft C # after the year 2000 .NET platform development language masters, the development so far has 17 years of history, language itself has a rich feature set, Microsoft has updated its support is also very supportive. Microsoft C # will be submitted to the standards body ECMA, C # 5.0 is currently the ECMA released the latest specification, C # 6.0 or the draft stage, C # 7.1 is Microsoft's current offer the latest specification.
This is just as outlines, because the C # 5.0 specification is an ECMA standard version, so I chose to learn C # 5.0 as a major release, and project-based learning C # 6.0,7.0 version of the new features.
C # language specification GitHub repository See: https://github.com/dotnet/csharplang
C # language characteristics see the roadmap and Development:
https://github.com/dotnet/roslyn/blob/master/docs/Language%20Feature%20Status.md
language version | release time | .NET Framework Requirements | Visual Studio version |
---|---|---|---|
C# 1.0 | 2002.1 | .NET Framework 1.0 | Visual Studio .NET 2002 |
C# 1.1\1.2 | 2003.4 | .NET Framework 1.1 | Visual Studio .NET 2003 |
C# 2.0 | 2005.11 | .NET Framework 2.0 | Visual Studio 2005 |
C# 3.0 | 2007.11 | .NET Framework 2.0\3.0\3.5 | Visual Studio 2008 |
C# 4.0 | 2010.4 | .NET Framework 4.0 | Visual Studio 2010 |
C# 5.0 | 2012.8 | .NET Framework 4.5 | Visual Studio 2012\2013 |
C# 6.0 | 2015.7 | .NET Framework 4.6 | Visual Studio 2015 |
C# 7.0 | 2017.3 | .NET Framework 4.6.2 | Visual Studio 2017 |
C# 7.1 | 2017.6 | .NET Framework | Visual Studio 2017 v15.3 Preview |
C# 8.0 | To be released | .NET Framework 4.7.1 | Visual Studio 2017 v15.7 |
C # 1.0 properties
The first version, the characteristics of the most basic programming language.
- Classes: object-oriented features, class type support
- Structs: Structure
- Interfaces: Interface
- Events: Events
- Properties: member properties, class, provides a flexible way to access fields
- Delegates: delegate a reference type, reference to a method represents a particular parameter list and return type
- Expressions, Statements, Operators: expressions, statements, operators,
- Attributes: properties declared or adding metadata information as program code, when executed, the characteristic information can be accessed through reflection
- Literals: literal (or understood as a constant value), the difference between the constants, variables, and constants are opposed
C # 2 properties (VS 2005)
- Generics: Generics
- Partial types: partial type, may be split classes, structures, and other types of interfaces to define a plurality of files
- Anonymous methods: Anonymous Methods
- Iterators: Iterators
- Nullable types: Null may be of the type, class, or other values may be null
- Getter / setter separate accessibility: access control attributes
- Method group conversions (delegates): Group conversion method can be a set of methods delegate declaration, implicitly calls
- Co- and Contra-variance for delegates and interfaces: commissioned, covariance and interfaces
- Static classes: static class
- Delegate inference: inference commissioned, allowing direct method name assigned to the variable commission
C # 3 properties (VS 2008)
- Implicitly typed local variables:
- Object and collection initializers: Object and collection initializers
- Auto-Implemented properties: automatic properties, automatic generation of property methods, more concise statement
- Anonymous types: Anonymous Types
- Extension methods: Extension Methods
- Query expressions: query expression
- Lambda expression: Lambda Expressions
- Expression trees: expression tree, a tree data structure represents the code is a new data type
- Partial methods: Method part
C # 4 properties (VS 2010)
- Dynamic binding: dynamic binding
- Named and optional arguments: named and optional parameters
- Generic co- and contravariance: Covariance and generics
- Embedded interop types ( "NoPIA"): Open the embedded type information, increase the reference COM component programs neutrality
C # 5 properties (VS 2012)
- Asynchronous methods: asynchronous method
- Caller info attributes: the caller information characteristics, access information when the caller calls
C # 6 wherein (VS 2015)
- Compiler-as-a-service (Roslyn)
- Import of static type members into namespace: Import supports only static member class
- Exception filters: Exception Filter
- Await in catch / finally blocks: supports await statements in catch / finally statement block
- Auto property initializers: automatic attribute initialization
- Default values for getter-only properties: Set the default value of the read-only attribute
- Expression-bodied members: Support the members as the main method of expression and the read-only attribute
- Null propagator (null-conditional operator, succinct null checking): Null conditional operator
- String interpolation: string interpolation, a new method of generating specific format string
- NameOf operator name, the method returns, attributes, variables: nameof operator
- Dictionary initializer: Initialization dictionary
C # 7 features (Visual Studio 2017)
- Out variables: out variables declared directly, for example, out in parameter
- Pattern matching: pattern matching, distributed according to the object type or other property implementation method
- Tuples: tuple
- Deconstruction: tuple parsing
- Discards: not named variables are placeholders, without using the value after the code
- Local Functions: a local function
- Binary Literals: binary literals
- Digit Separators: number separators
- Ref returns and locals: local variables and return a reference value
- Generalized async return types: async using generic return types
- More expression-bodied members: allows for the construction, a parser, an expression may be used as body attributes
- Throw expressions: Throw can be used in expressions
C # 7.1 features (Visual Studio 2017 version 15.3)
- Async main: async mode in the main method
- Default expressions: the introduction of new literal default
- Reference assemblies:
- Inferred tuple element names:
- Pattern-matching with generics:
C # 8.0 features (Visual Studio 2017 version 15.7)
- Default Interface Methods default interface
- Nullable reference type NullableReferenceTypes non-empty and controllable type of data
- Recursive patterns recursive mode
- Async streams of asynchronous data streams
- Caller expression attribute method call expression property
- Target-typed new
- Generic attributes common attributes
- Ranges
- Default in deconstruction
- Relax ordering of ref and partial modifiers 转自https://www.cnblogs.com/Justsoso-WYH/p/9446958.html