From f075e4df870d77bda538b2d59c01332806796ce1 Mon Sep 17 00:00:00 2001 From: Erik Dietrich Date: Tue, 8 Aug 2017 23:34:14 -0400 Subject: [PATCH 1/9] Create csharp-version-history.md --- docs/csharp/whats-new/csharp-version-history.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/csharp/whats-new/csharp-version-history.md diff --git a/docs/csharp/whats-new/csharp-version-history.md b/docs/csharp/whats-new/csharp-version-history.md new file mode 100644 index 0000000000000..8b137891791fe --- /dev/null +++ b/docs/csharp/whats-new/csharp-version-history.md @@ -0,0 +1 @@ + From 317b79143e270b428f340a8cd247829682f3ffeb Mon Sep 17 00:00:00 2001 From: Erik Dietrich Date: Tue, 8 Aug 2017 23:57:50 -0400 Subject: [PATCH 2/9] Added the actual text --- .../whats-new/csharp-version-history.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) diff --git a/docs/csharp/whats-new/csharp-version-history.md b/docs/csharp/whats-new/csharp-version-history.md index 8b137891791fe..826027d987173 100644 --- a/docs/csharp/whats-new/csharp-version-history.md +++ b/docs/csharp/whats-new/csharp-version-history.md @@ -1 +1,115 @@ +I still remember my first look at C# in the early 2000s. Microsoft had released the first major version of the language. I recall thinking that it was Java, except that Microsoft made it, called it something else, and put it into Visual Studio. And I wasn't alone in this sentiment. In [an old interview](https://www.cnet.com/news/why-microsofts-c-isnt/), Java inventor James Gosling called it an imitation. "It's sort of Java with reliability, productivity, and security deleted," he said. Ouch. +A lot changes in 15 years or so. I doubt anyone would offer a similar assessment today. In that time, Java has released four major language versions, while C# has released six. The languages have charted divergent courses, and C# has seen a great deal of innovation. Today, I'd like to take a look back on the history of C# and highlight some of those key points. + +What did the language look like in its earliest incarnations? And how has it evolved in the years since? + +### **C# Version 1** + +When you go back and look, C# version 1 really did look an awful lot like Java. As [part of its stated design goals for ECMA](http://feeldotneteasy.blogspot.com/2011/01/c-design-goals.html), it sought to be a "simple, modern, general purpose object-oriented language." At the time, it could have done worse thank looking like Java in order to achieve those goals. + +But if you looked back on C# 1.0 now, you'd find yourself a little dizzy. It lacked the built in async capabilities and some of the slick functionality around generics that we take for granted. As a matter of fact, it lacked generics altogether. And [Linq](https://msdn.microsoft.com/en-us/library/bb308959.aspx)? Nope. That would take some years to come out. + +C# version 1 looked pretty stripped of features, compared to today. You'd find yourself writing some verbose code. But yet, you have to start somewhere. + +### **C# Version 2** + +Now things start to get interesting. Let's take a look at some major features of C# 2.0, released in 2005, along with Visual Studio 2005. + +- [Generics](https://www.tutorialspoint.com/csharp/csharp_generics.htm) +- [Partial types](https://www.dotnetperls.com/partial) +- [Anonymous methods](https://www.tutorialspoint.com/csharp/csharp_anonymous_methods.htm) +- [Nullable types](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/nullable-types/) +- [Iterators](https://msdn.microsoft.com/en-us/library/65zzykke(v=vs.100).aspx) +- [Covariance and contravariance](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/covariance-contravariance/) + +While Microsoft may have started with a pretty generic object-oriented language, C# Version 2 changed that in a hurry. Once they had their feet under them, they went after some serious developer pain points. And they went after them in a big way. + +With generics, you have types and methods that can operate on an arbitrary type while still retaining type safety. So, for instance, having a List<T> lets you have List<string> or List<int> and perform type safe operations on those strings or ints while you iterate through them. This certainly beats creating ListInt inheritors or casting from Object for every operation. + +Oh, and speaking of iterators, C# Version 2 brought iterators. To put it succinctly, this let you iterate through the items in List (or other Enumerable types) with a foreach loop. Having this as a first class part of the language dramatically enhanced readability of the language and people's ability to reason about the code. + +And yet, Microsoft continued to play a bit of catch up with Java. Java had already released versions that included generics and iterators. But that would soon change as the languages continued to evolve apart. + +### **C# Version 3** + +C# Version 3 came in late 2007, along with Visual Studio 2008, though the full boat of language features would actually come with C# Version 3.5. And what a version this proved to be. I would go so far as to say that this established C# as a truly formidable programming language. Let's take a look at some major features in this version. + +- [Auto implemented properties](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/auto-implemented-properties) +- [Anonymous types](http://www.c-sharpcorner.com/UploadFile/ff2f08/anonymous-types-in-C-Sharp/) +- [Query expressions](https://docs.microsoft.com/en-us/dotnet/csharp/linq/query-expression-basics) +- [Lambda expression](https://www.daedtech.com/introduction-to-c-lambda-expressions/) +- [Expression trees](https://blogs.msdn.microsoft.com/charlie/2008/01/31/expression-tree-basics/) +- [Extension methods](https://www.codeproject.com/Tips/709310/Extension-Method-In-Csharp) + +In retrospect, many of these features seem both inevitable and inseparable. In fact, I have a hard time a true headliner, since they all fit together so strategically. Others won't have that same problem, though. They'll say that C# Version 3's killer feature was the query expression, also known as Linq ( **L** anguage **IN** tegrated **Q** uery). + +I chase a little more nuance because I view expression tress, lamba expressions and anonymous types as the foundation upon which they constructed Linq. But, in either case, we found ourselves presented with a fairly revolutionary concept. Microsoft had begun to lay the groundwork for turning C# into a hybrid OO-functional language. + +Specifically, you could now write SQL-style, declarative queries to perform operations on collections, among other things. Instead of writing a for loop to compute the average of a list of integers, you could now do that as simply as list.Average(). The combination of query expressions and extension methods made it look as though that list of ints had gotten a whole lot smarter. + +It took a little while for people to really grasp and integrate the concept, but they gradually did. And now, years later, code is much more concise, simple, and functional. + +### **C# Version 4** + +C# Version 4 would have had a difficult time living up to the groundbreaking status of version 3. With version 3, Microsoft had moved the language firmly out from the shadow of Java and into prominence. The language was quickly becoming elegant. + +The next version did introduce some cool stuff, though. + +- [Dynamic binding](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/dynamic) +- [Named/optional arguments](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/named-and-optional-arguments) +- [Generic covariant and contravariant](https://docs.microsoft.com/en-us/dotnet/standard/generics/covariance-and-contravariance) +- [Embedded interop types](https://stackoverflow.com/questions/20514240/whats-the-difference-setting-embed-interop-types-true-and-false-in-visual-studi) + +Embedded interop types alleviated a deployment pain. Generic covariance and contravariance give you a lot of power, but they're a bit academic and probably most appreciated by framework and library authors. Named and optional parameters let you eliminate a lot of method overloads and provide convenience. But none of those are exactly paradigm altering. + +I'll leave that distinction for the introduction of the dynamic keyword. By doing this, Microsoft introduced into C# Version 4 the ability to override the compiler on compile time typing. That's right. By using the dynamic keyword, you can now shoot yourself in the foot a la dynamically typed languages like JavaScript. You can create a dynamic x = "a string" and then add six to it, leaving it up to the runtime to sort out what on earth should happen next. + +I say that a bit tongue in cheek, obviously. This gives you the potential for errors but also great power within the language. + +### **C# Version 5** + +With C# Version 5, Microsoft released a very focused version of the language. They put nearly all of their effort for that version into another pretty groundbreaking language concept. Here is the major features list. + +- [Asynchronous members](https://msdn.microsoft.com/library/hh191443(vs.110).aspx) +- [Caller info attributes](https://www.codeproject.com/Tips/606379/Caller-Info-Attributes-in-Csharp) + +Now, don't get me wrong. The caller info attribute is pretty cool. It lets you easily retrieve information about the context in which you're running without resorting to a ton of boilerplate reflection code. I actually love this feature. + +But async and await are the real stars of this release. When this came out in 2012, Microsoft changed the game again by baking asynchrony into the language as a first class participant. If you've ever dealt with long running operations and the implementation of webs of callbacks, you probably loved this language feature. + +### **C# Version 6** + +With versions 3 and 5, Microsoft had done some pretty impressive stuff in an OO language. (Version 2 did as well, but they were fast following Java with those language features.) With version 6, they would go away from doing a dominant killer feature and instead release a lot of features that delighted users of the language. Here are some of them. + +- [Static imports (a la Java)](http://geekswithblogs.net/BlackRabbitCoder/archive/2015/04/16/c.net-little-wonders-static-using-statements-in-c-6.aspx) +- [Exception filters](https://www.thomaslevesque.com/2015/06/21/exception-filters-in-c-6/) +- [Property initializers](http://geekswithblogs.net/WinAZ/archive/2015/06/30/whatrsquos-new-in-c-6.0-auto-property-initializers.aspx) +- [Expression bodied members](https://lostechies.com/jimmybogard/2015/12/17/c-6-feature-review-expression-bodied-function-members/) +- [Null propagator](https://davefancher.com/2014/08/14/c-6-0-null-propagation-operator/) +- [String interpolation](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/interpolated-strings) +- [nameof operator](https://stackoverflow.com/questions/31695900/what-is-the-purpose-of-nameof) +- [Dictionary initializer](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/how-to-initialize-a-dictionary-with-a-collection-initializer) + +Taken individually, these are all cool language features. But if you look at them altogether, you see an interesting pattern. In this version, Microsoft worked really hard to eliminate language boilerplate and make code more terse and readable. So for fans of clean, simple code, this language version was a huge win. + +Oh, and they did do one other thing along with this version, though it's not a traditional language feature, per se. They released [Roslyn the compiler as a service](https://github.com/dotnet/roslyn). Microsoft now uses C# to build C#, and they let you use the compiler as part of your programming efforts. + +### **C# Version 7** + +Finally, we arrive at C# version 7. That's the current version as of the writing of this post. This has some evolutionary and cool stuff in the vein of C# 6, but without the compiler as a service. Here are some of the new features. + +- [Out variables](http://www.c-sharpcorner.com/article/out-variables-in-c-sharp-7-0/) +- [Tuples and deconstruction](https://www.thomaslevesque.com/2016/08/23/tuple-deconstruction-in-c-7/) +- [Pattern matching](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-7#pattern-matching) +- [Local functions](http://www.infoworld.com/article/3182416/application-development/c-7-in-depth-exploring-local-functions.html) +- [Expanded expression bodied members](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-7#more-expression-bodied-members) +- [Ref locals and returns](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-7#ref-locals-and-returns) + +All of these offer cool new capabilities for developers and the opportunity to write even cleaner code than ever. In particular, I think Microsoft scratched some long term itches by condensing the declaration of variables to use with the "out" keyword and by allowing multiple return values via tuple. + +But Microsoft is also busy putting the language to ever broader use. .NET now targets any operating system and has its eyes firmly on the cloud and on portability. This certainly occupies the language designers' thoughts and time, in addition to coming up with new features. + +I've been familiar with C# for just under 15 years now, and the language has been under development for even longer than that. It'll be exciting to see what features and capabilities the future brings. + +_Article_ [_originally published on the NDepend blog_](https://blog.ndepend.com/c-versions-look-language-history/)_, courtesy of Erik Dietrich and Patrick Smacchia._ From d6f2512fa1b00657c06743352c03d5dc2277b998 Mon Sep 17 00:00:00 2001 From: Erik Dietrich Date: Wed, 9 Aug 2017 00:01:32 -0400 Subject: [PATCH 3/9] Updated TOC with my entry. --- docs/toc.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/toc.md b/docs/toc.md index 14212df93f8f2..ddd55593b1468 100644 --- a/docs/toc.md +++ b/docs/toc.md @@ -182,6 +182,7 @@ ## [What's new in C#](csharp/whats-new/index.md) ### [What's new in C# 7](csharp/whats-new/csharp-7.md) ### [What's new in C# 6](csharp/whats-new/csharp-6.md) +### [C# Version History](csharp/whats-new/csharp-version-history.md) From 313b4e50e633c2e50a2ad607bc368aedacf520a4 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Wed, 9 Aug 2017 14:50:34 -0400 Subject: [PATCH 4/9] first pass edit 1. Add Metadata 1. Change person 1. Formalize from blog post to docs style language. --- .../whats-new/csharp-version-history.md | 67 +++++++++++-------- 1 file changed, 38 insertions(+), 29 deletions(-) diff --git a/docs/csharp/whats-new/csharp-version-history.md b/docs/csharp/whats-new/csharp-version-history.md index 826027d987173..b795f57a7a52b 100644 --- a/docs/csharp/whats-new/csharp-version-history.md +++ b/docs/csharp/whats-new/csharp-version-history.md @@ -1,10 +1,21 @@ -I still remember my first look at C# in the early 2000s. Microsoft had released the first major version of the language. I recall thinking that it was Java, except that Microsoft made it, called it something else, and put it into Visual Studio. And I wasn't alone in this sentiment. In [an old interview](https://www.cnet.com/news/why-microsofts-c-isnt/), Java inventor James Gosling called it an imitation. "It's sort of Java with reliability, productivity, and security deleted," he said. Ouch. - -A lot changes in 15 years or so. I doubt anyone would offer a similar assessment today. In that time, Java has released four major language versions, while C# has released six. The languages have charted divergent courses, and C# has seen a great deal of innovation. Today, I'd like to take a look back on the history of C# and highlight some of those key points. +--- +title: The History of C# - C# Guide +description: What did the language look like in its earliest versions, and how has it evolved since? +keywords: C#, .NET, .NET Core, What's New, C# History +author: erikdietrich +ms.author: wiwagn +ms.date: 2017/08/09 +ms.topic: article +ms.prod: visual-studio-dev-15 +ms.technology: devlang-csharp +ms.devlang: csharp +--- + +# The History of C# # What did the language look like in its earliest incarnations? And how has it evolved in the years since? -### **C# Version 1** +## C# Version 1 When you go back and look, C# version 1 really did look an awful lot like Java. As [part of its stated design goals for ECMA](http://feeldotneteasy.blogspot.com/2011/01/c-design-goals.html), it sought to be a "simple, modern, general purpose object-oriented language." At the time, it could have done worse thank looking like Java in order to achieve those goals. @@ -12,7 +23,7 @@ But if you looked back on C# 1.0 now, you'd find yourself a little dizzy. I C# version 1 looked pretty stripped of features, compared to today. You'd find yourself writing some verbose code. But yet, you have to start somewhere. -### **C# Version 2** +## C# Version 2 Now things start to get interesting. Let's take a look at some major features of C# 2.0, released in 2005, along with Visual Studio 2005. @@ -23,17 +34,17 @@ Now things start to get interesting. Let's take a look at some major featur - [Iterators](https://msdn.microsoft.com/en-us/library/65zzykke(v=vs.100).aspx) - [Covariance and contravariance](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/covariance-contravariance/) -While Microsoft may have started with a pretty generic object-oriented language, C# Version 2 changed that in a hurry. Once they had their feet under them, they went after some serious developer pain points. And they went after them in a big way. +While C# may have started as a pretty generic object-oriented language, C# Version 2 changed that in a hurry. Once they had their feet under them, they went after some serious developer pain points. And they went after them in a big way. With generics, you have types and methods that can operate on an arbitrary type while still retaining type safety. So, for instance, having a List<T> lets you have List<string> or List<int> and perform type safe operations on those strings or ints while you iterate through them. This certainly beats creating ListInt inheritors or casting from Object for every operation. Oh, and speaking of iterators, C# Version 2 brought iterators. To put it succinctly, this let you iterate through the items in List (or other Enumerable types) with a foreach loop. Having this as a first class part of the language dramatically enhanced readability of the language and people's ability to reason about the code. -And yet, Microsoft continued to play a bit of catch up with Java. Java had already released versions that included generics and iterators. But that would soon change as the languages continued to evolve apart. +And yet, C# continued to play a bit of catch up with Java. Java had already released versions that included generics and iterators. But that would soon change as the languages continued to evolve apart. -### **C# Version 3** +## C# Version 3 -C# Version 3 came in late 2007, along with Visual Studio 2008, though the full boat of language features would actually come with C# Version 3.5. And what a version this proved to be. I would go so far as to say that this established C# as a truly formidable programming language. Let's take a look at some major features in this version. +C# Version 3 came in late 2007, along with Visual Studio 2008, though the full boat of language features would actually come with C# Version 3.5. And what a version this proved to be. This established C# as a truly formidable programming language. Let's take a look at some major features in this version. - [Auto implemented properties](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/auto-implemented-properties) - [Anonymous types](http://www.c-sharpcorner.com/UploadFile/ff2f08/anonymous-types-in-C-Sharp/) @@ -42,17 +53,17 @@ C# Version 3 came in late 2007, along with Visual Studio 2008, though the full b - [Expression trees](https://blogs.msdn.microsoft.com/charlie/2008/01/31/expression-tree-basics/) - [Extension methods](https://www.codeproject.com/Tips/709310/Extension-Method-In-Csharp) -In retrospect, many of these features seem both inevitable and inseparable. In fact, I have a hard time a true headliner, since they all fit together so strategically. Others won't have that same problem, though. They'll say that C# Version 3's killer feature was the query expression, also known as Linq ( **L** anguage **IN** tegrated **Q** uery). +In retrospect, many of these features seem both inevitable and inseparable. They all fit together so strategically. It's generally thought that C# Version 3's killer feature was the query expression, also known as Linq ( **L** anguage **IN** tegrated **Q** uery). -I chase a little more nuance because I view expression tress, lamba expressions and anonymous types as the foundation upon which they constructed Linq. But, in either case, we found ourselves presented with a fairly revolutionary concept. Microsoft had begun to lay the groundwork for turning C# into a hybrid OO-functional language. +A more nuanced view examines expression tress, lamba expressions and anonymous types as the foundation upon which LINQ is constructed. But, in either case, C# 3 presented with a fairly revolutionary concept. C# 3 had begun to lay the groundwork for turning C# into a hybrid OO-functional language. Specifically, you could now write SQL-style, declarative queries to perform operations on collections, among other things. Instead of writing a for loop to compute the average of a list of integers, you could now do that as simply as list.Average(). The combination of query expressions and extension methods made it look as though that list of ints had gotten a whole lot smarter. It took a little while for people to really grasp and integrate the concept, but they gradually did. And now, years later, code is much more concise, simple, and functional. -### **C# Version 4** +## C# Version 4 -C# Version 4 would have had a difficult time living up to the groundbreaking status of version 3. With version 3, Microsoft had moved the language firmly out from the shadow of Java and into prominence. The language was quickly becoming elegant. +C# Version 4 would have had a difficult time living up to the groundbreaking status of version 3. With version 3, C# had moved the language firmly out from the shadow of Java and into prominence. The language was quickly becoming elegant The next version did introduce some cool stuff, though. @@ -63,24 +74,24 @@ The next version did introduce some cool stuff, though. Embedded interop types alleviated a deployment pain. Generic covariance and contravariance give you a lot of power, but they're a bit academic and probably most appreciated by framework and library authors. Named and optional parameters let you eliminate a lot of method overloads and provide convenience. But none of those are exactly paradigm altering. -I'll leave that distinction for the introduction of the dynamic keyword. By doing this, Microsoft introduced into C# Version 4 the ability to override the compiler on compile time typing. That's right. By using the dynamic keyword, you can now shoot yourself in the foot a la dynamically typed languages like JavaScript. You can create a dynamic x = "a string" and then add six to it, leaving it up to the runtime to sort out what on earth should happen next. +The major feature was the introduction of the dynamic keyword. The `dynamic` introduced into C# Version 4 the ability to override the compiler on compile time typing. By using the dynamic keyword, you can create constructs similar to dynamically typed languages like JavaScript. You can create a dynamic x = "a string" and then add six to it, leaving it up to the runtime to sort out what on should happen next. -I say that a bit tongue in cheek, obviously. This gives you the potential for errors but also great power within the language. +This gives you the potential for errors but also great power within the language. -### **C# Version 5** +## C# Version 5 -With C# Version 5, Microsoft released a very focused version of the language. They put nearly all of their effort for that version into another pretty groundbreaking language concept. Here is the major features list. +C# Version 5 wasa very focused version of the language. Nearly all of their effort for that version into another pretty groundbreaking language concept. Here is the major features list. - [Asynchronous members](https://msdn.microsoft.com/library/hh191443(vs.110).aspx) - [Caller info attributes](https://www.codeproject.com/Tips/606379/Caller-Info-Attributes-in-Csharp) -Now, don't get me wrong. The caller info attribute is pretty cool. It lets you easily retrieve information about the context in which you're running without resorting to a ton of boilerplate reflection code. I actually love this feature. +The caller info attribute is pretty cool. It lets you easily retrieve information about the context in which you're running without resorting to a ton of boilerplate reflection code. Many developers love this feature. -But async and await are the real stars of this release. When this came out in 2012, Microsoft changed the game again by baking asynchrony into the language as a first class participant. If you've ever dealt with long running operations and the implementation of webs of callbacks, you probably loved this language feature. +But async and await are the real stars of this release. When this came out in 2012, C# changed the game again by baking asynchrony into the language as a first class participant. If you've ever dealt with long running operations and the implementation of webs of callbacks, you probably loved this language feature. -### **C# Version 6** +## C# Version 6 -With versions 3 and 5, Microsoft had done some pretty impressive stuff in an OO language. (Version 2 did as well, but they were fast following Java with those language features.) With version 6, they would go away from doing a dominant killer feature and instead release a lot of features that delighted users of the language. Here are some of them. +With versions 3 and 5, C# had added some pretty impressive stuff in an OO language. (Version 2 did as well, but it was fast following Java with those language features.) With version 6, it would go away from doing a dominant killer feature and instead release a lot of features that delighted users of the language. Here are some of them. - [Static imports (a la Java)](http://geekswithblogs.net/BlackRabbitCoder/archive/2015/04/16/c.net-little-wonders-static-using-statements-in-c-6.aspx) - [Exception filters](https://www.thomaslevesque.com/2015/06/21/exception-filters-in-c-6/) @@ -91,13 +102,13 @@ With versions 3 and 5, Microsoft had done some pretty impressive stuff in an OO - [nameof operator](https://stackoverflow.com/questions/31695900/what-is-the-purpose-of-nameof) - [Dictionary initializer](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/how-to-initialize-a-dictionary-with-a-collection-initializer) -Taken individually, these are all cool language features. But if you look at them altogether, you see an interesting pattern. In this version, Microsoft worked really hard to eliminate language boilerplate and make code more terse and readable. So for fans of clean, simple code, this language version was a huge win. +Taken individually, these are all cool language features. But if you look at them altogether, you see an interesting pattern. In this version, C# eliminated language boilerplate to make code more terse and readable. So for fans of clean, simple code, this language version was a huge win. -Oh, and they did do one other thing along with this version, though it's not a traditional language feature, per se. They released [Roslyn the compiler as a service](https://github.com/dotnet/roslyn). Microsoft now uses C# to build C#, and they let you use the compiler as part of your programming efforts. +Oh, and they did do one other thing along with this version, though it's not a traditional language feature, per se. They released [Roslyn the compiler as a service](https://github.com/dotnet/roslyn). C# now uses C# to build C#, and they let you use the compiler as part of your programming efforts. -### **C# Version 7** +## C# Version 7 -Finally, we arrive at C# version 7. That's the current version as of the writing of this post. This has some evolutionary and cool stuff in the vein of C# 6, but without the compiler as a service. Here are some of the new features. +Finally, we arrive at C# version 7. This has some evolutionary and cool stuff in the vein of C# 6, but without the compiler as a service. Here are some of the new features. - [Out variables](http://www.c-sharpcorner.com/article/out-variables-in-c-sharp-7-0/) - [Tuples and deconstruction](https://www.thomaslevesque.com/2016/08/23/tuple-deconstruction-in-c-7/) @@ -106,10 +117,8 @@ Finally, we arrive at C# version 7. That's the current version as of the wr - [Expanded expression bodied members](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-7#more-expression-bodied-members) - [Ref locals and returns](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-7#ref-locals-and-returns) -All of these offer cool new capabilities for developers and the opportunity to write even cleaner code than ever. In particular, I think Microsoft scratched some long term itches by condensing the declaration of variables to use with the "out" keyword and by allowing multiple return values via tuple. - -But Microsoft is also busy putting the language to ever broader use. .NET now targets any operating system and has its eyes firmly on the cloud and on portability. This certainly occupies the language designers' thoughts and time, in addition to coming up with new features. +All of these offer cool new capabilities for developers and the opportunity to write even cleaner code than ever. A highlight is condensing the declaration of variables to use with the `out` keyword and by allowing multiple return values via tuple. -I've been familiar with C# for just under 15 years now, and the language has been under development for even longer than that. It'll be exciting to see what features and capabilities the future brings. +But C# is being put to ever broader use. .NET now targets any operating system and has its eyes firmly on the cloud and on portability. This certainly occupies the language designers' thoughts and time, in addition to coming up with new features. _Article_ [_originally published on the NDepend blog_](https://blog.ndepend.com/c-versions-look-language-history/)_, courtesy of Erik Dietrich and Patrick Smacchia._ From d929780e59ac4225e23035edb83586c95000611f Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Mon, 11 Sep 2017 16:02:58 -0400 Subject: [PATCH 5/9] Update csharp-version-history.md --- .../whats-new/csharp-version-history.md | 84 +++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/docs/csharp/whats-new/csharp-version-history.md b/docs/csharp/whats-new/csharp-version-history.md index b795f57a7a52b..680fa03fb2ac7 100644 --- a/docs/csharp/whats-new/csharp-version-history.md +++ b/docs/csharp/whats-new/csharp-version-history.md @@ -1,50 +1,50 @@ --- -title: The History of C# - C# Guide +title: The history of C# - C# Guide description: What did the language look like in its earliest versions, and how has it evolved since? keywords: C#, .NET, .NET Core, What's New, C# History author: erikdietrich ms.author: wiwagn -ms.date: 2017/08/09 +ms.date: 09/11/2017 ms.topic: article -ms.prod: visual-studio-dev-15 +ms.prod: .net ms.technology: devlang-csharp ms.devlang: csharp --- -# The History of C# # +# The history of C# # -What did the language look like in its earliest incarnations? And how has it evolved in the years since? +What did the language look like in its earliest incarnations? And how has it evolved in the years since? -## C# Version 1 +## C# version 1.0 -When you go back and look, C# version 1 really did look an awful lot like Java. As [part of its stated design goals for ECMA](http://feeldotneteasy.blogspot.com/2011/01/c-design-goals.html), it sought to be a "simple, modern, general purpose object-oriented language." At the time, it could have done worse thank looking like Java in order to achieve those goals. +When you go back and look, C# version 1.0 looked a lot like Java. As [part of its stated design goals for ECMA](http://feeldotneteasy.blogspot.com/2011/01/c-design-goals.html), it sought to be a "simple, modern, general purpose object-oriented language." At the time, looking like Java meant it achieved those early design goals. -But if you looked back on C# 1.0 now, you'd find yourself a little dizzy. It lacked the built in async capabilities and some of the slick functionality around generics that we take for granted. As a matter of fact, it lacked generics altogether. And [Linq](https://msdn.microsoft.com/en-us/library/bb308959.aspx)? Nope. That would take some years to come out. +But if you look back on C# 1.0 now, you'd find yourself a little dizzy. It lacked the built-in async capabilities and some of the slick functionality around generics that we take for granted. As a matter of fact, it lacked generics altogether. And [LINQ](https://docs.microsoft.com/en-us/dotnet/csharp/linq/)? Not available yet. That would take some years to come out. -C# version 1 looked pretty stripped of features, compared to today. You'd find yourself writing some verbose code. But yet, you have to start somewhere. +C# version 1.0 looked stripped of features, compared to today. You'd find yourself writing some verbose code. But yet, you have to start somewhere. C# version 1.0 was a viable alternative to Java on the Windows platform. -## C# Version 2 +## C# version 2.0 -Now things start to get interesting. Let's take a look at some major features of C# 2.0, released in 2005, along with Visual Studio 2005. +Now things start to get interesting. Let's take a look at some major features of C# 2.0, released in 2005, along with Visual Studio 2005. -- [Generics](https://www.tutorialspoint.com/csharp/csharp_generics.htm) +- [Generics](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/generics/) - [Partial types](https://www.dotnetperls.com/partial) - [Anonymous methods](https://www.tutorialspoint.com/csharp/csharp_anonymous_methods.htm) -- [Nullable types](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/nullable-types/) +- [Nullable types](./csharp/programming-guide/nullable-types/) - [Iterators](https://msdn.microsoft.com/en-us/library/65zzykke(v=vs.100).aspx) -- [Covariance and contravariance](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/covariance-contravariance/) +- [Covariance and contravariance](./programming-guide/concepts/covariance-contravariance/) -While C# may have started as a pretty generic object-oriented language, C# Version 2 changed that in a hurry. Once they had their feet under them, they went after some serious developer pain points. And they went after them in a big way. +While C# may have started as a pretty generic Object-Oriented (OO) language, C# Version 2.0 changed that in a hurry. Once they had their feet under them, they went after some serious developer pain points. And they went after them in a big way. -With generics, you have types and methods that can operate on an arbitrary type while still retaining type safety. So, for instance, having a List<T> lets you have List<string> or List<int> and perform type safe operations on those strings or ints while you iterate through them. This certainly beats creating ListInt inheritors or casting from Object for every operation. +With generics, you have types and methods that can operate on an arbitrary type while still retaining type safety. So, for instance, having a lets you have `List` or `List` and perform type safe operations on those strings or integers while you iterate through them. This is better than creating `ListInt` inheritors or casting from `Object` for every operation. -Oh, and speaking of iterators, C# Version 2 brought iterators. To put it succinctly, this let you iterate through the items in List (or other Enumerable types) with a foreach loop. Having this as a first class part of the language dramatically enhanced readability of the language and people's ability to reason about the code. +C# Version 2.0 brought iterators. To put it succinctly, this lets you iterate through the items in a `List` (or other Enumerable types) with a `foreach` loop. Having this as a first class part of the language dramatically enhanced readability of the language and people's ability to reason about the code. -And yet, C# continued to play a bit of catch up with Java. Java had already released versions that included generics and iterators. But that would soon change as the languages continued to evolve apart. +And yet, C# continued to play a bit of catch-up with Java. Java had already released versions that included generics and iterators. But that would soon change as the languages continued to evolve apart. -## C# Version 3 +## C# version 3.0 -C# Version 3 came in late 2007, along with Visual Studio 2008, though the full boat of language features would actually come with C# Version 3.5. And what a version this proved to be. This established C# as a truly formidable programming language. Let's take a look at some major features in this version. +C# Version 3.0 came in late 2007, along with Visual Studio 2008, though the full boat of language features would actually come with C# Version 3.5. This version marked a major change in the growth of C#. It established C# as a truly formidable programming language. Let's take a look at some major features in this version. - [Auto implemented properties](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/auto-implemented-properties) - [Anonymous types](http://www.c-sharpcorner.com/UploadFile/ff2f08/anonymous-types-in-C-Sharp/) @@ -53,47 +53,47 @@ C# Version 3 came in late 2007, along with Visual Studio 2008, though the full b - [Expression trees](https://blogs.msdn.microsoft.com/charlie/2008/01/31/expression-tree-basics/) - [Extension methods](https://www.codeproject.com/Tips/709310/Extension-Method-In-Csharp) -In retrospect, many of these features seem both inevitable and inseparable. They all fit together so strategically. It's generally thought that C# Version 3's killer feature was the query expression, also known as Linq ( **L** anguage **IN** tegrated **Q** uery). +In retrospect, many of these features seem both inevitable and inseparable. They all fit together strategically. It's generally thought that C# version's killer feature was the query expression, also known as Language-Integrated Query (LINQ). -A more nuanced view examines expression tress, lamba expressions and anonymous types as the foundation upon which LINQ is constructed. But, in either case, C# 3 presented with a fairly revolutionary concept. C# 3 had begun to lay the groundwork for turning C# into a hybrid OO-functional language. +A more nuanced view examines expression tress, lambda expressions, and anonymous types as the foundation upon which LINQ is constructed. But, in either case, C# 3.0 presented with a fairly revolutionary concept. C# 3.0 had begun to lay the groundwork for turning C# into a hybrid Object Oriented / Functional language. -Specifically, you could now write SQL-style, declarative queries to perform operations on collections, among other things. Instead of writing a for loop to compute the average of a list of integers, you could now do that as simply as list.Average(). The combination of query expressions and extension methods made it look as though that list of ints had gotten a whole lot smarter. +Specifically, you could now write SQL-style, declarative queries to perform operations on collections, among other things. Instead of writing a `for` loop to compute the average of a list of integers, you could now do that as simply as `list.Average()`. The combination of query expressions and extension methods made it look as though that list of ints had gotten a whole lot smarter. -It took a little while for people to really grasp and integrate the concept, but they gradually did. And now, years later, code is much more concise, simple, and functional. +It took time for people to really grasp and integrate the concept, but they gradually did. And now, years later, code is much more concise, simple, and functional. -## C# Version 4 +## C# version 4.0 -C# Version 4 would have had a difficult time living up to the groundbreaking status of version 3. With version 3, C# had moved the language firmly out from the shadow of Java and into prominence. The language was quickly becoming elegant +C# Version 4.0 would have had a difficult time living up to the groundbreaking status of version 3.0. With version 3.0, C# had moved the language firmly out from the shadow of Java and into prominence. The language was quickly becoming elegant. -The next version did introduce some cool stuff, though. +The next version did introduce some interesting new features. - [Dynamic binding](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/dynamic) - [Named/optional arguments](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/named-and-optional-arguments) - [Generic covariant and contravariant](https://docs.microsoft.com/en-us/dotnet/standard/generics/covariance-and-contravariance) - [Embedded interop types](https://stackoverflow.com/questions/20514240/whats-the-difference-setting-embed-interop-types-true-and-false-in-visual-studi) -Embedded interop types alleviated a deployment pain. Generic covariance and contravariance give you a lot of power, but they're a bit academic and probably most appreciated by framework and library authors. Named and optional parameters let you eliminate a lot of method overloads and provide convenience. But none of those are exactly paradigm altering. +Embedded interop types alleviated a deployment pain. Generic covariance and contravariance give you more power to use generics, but they're a bit academic and probably most appreciated by framework and library authors. Named and optional parameters let you eliminate many method overloads and provide convenience. But none of those features are exactly paradigm altering. -The major feature was the introduction of the dynamic keyword. The `dynamic` introduced into C# Version 4 the ability to override the compiler on compile time typing. By using the dynamic keyword, you can create constructs similar to dynamically typed languages like JavaScript. You can create a dynamic x = "a string" and then add six to it, leaving it up to the runtime to sort out what on should happen next. +The major feature was the introduction of the `dynamic` keyword. The `dynamic` keyword introduced into C# Version 4.0 the ability to override the compiler on compile-time typing. By using the dynamic keyword, you can create constructs similar to dynamically typed languages like JavaScript. You can create a `dynamic x = "a string"` and then add six to it, leaving it up to the runtime to sort out what should happen next. This gives you the potential for errors but also great power within the language. -## C# Version 5 +## C# version 5.0 -C# Version 5 wasa very focused version of the language. Nearly all of their effort for that version into another pretty groundbreaking language concept. Here is the major features list. +C# Version 5.0 was a very focused version of the language. Nearly all of the effort for that version went into another groundbreaking language concept. Here is the major features list. - [Asynchronous members](https://msdn.microsoft.com/library/hh191443(vs.110).aspx) - [Caller info attributes](https://www.codeproject.com/Tips/606379/Caller-Info-Attributes-in-Csharp) -The caller info attribute is pretty cool. It lets you easily retrieve information about the context in which you're running without resorting to a ton of boilerplate reflection code. Many developers love this feature. +The caller info attribute lets you easily retrieve information about the context in which you're running without resorting to a ton of boilerplate reflection code. It has many uses in diagnostics and logging tasks. -But async and await are the real stars of this release. When this came out in 2012, C# changed the game again by baking asynchrony into the language as a first class participant. If you've ever dealt with long running operations and the implementation of webs of callbacks, you probably loved this language feature. +But `async` and `await` are the real stars of this release. When these features came out in 2012, C# changed the game again by baking asynchrony into the language as a first-class participant. If you've ever dealt with long running operations and the implementation of webs of callbacks, you probably loved this language feature. -## C# Version 6 +## C# version 6.0 -With versions 3 and 5, C# had added some pretty impressive stuff in an OO language. (Version 2 did as well, but it was fast following Java with those language features.) With version 6, it would go away from doing a dominant killer feature and instead release a lot of features that delighted users of the language. Here are some of them. +With versions 3.0 and 5.0, C# had added some impressive features in an Object Oriented language. (Version 2.0 did as well, but it was fast following Java with those language features.) With version 6.0, it would go away from doing a dominant killer feature and instead release many features that delighted users of the language. Here are some of them. -- [Static imports (a la Java)](http://geekswithblogs.net/BlackRabbitCoder/archive/2015/04/16/c.net-little-wonders-static-using-statements-in-c-6.aspx) +- [Static imports](http://geekswithblogs.net/BlackRabbitCoder/archive/2015/04/16/c.net-little-wonders-static-using-statements-in-c-6.aspx) - [Exception filters](https://www.thomaslevesque.com/2015/06/21/exception-filters-in-c-6/) - [Property initializers](http://geekswithblogs.net/WinAZ/archive/2015/06/30/whatrsquos-new-in-c-6.0-auto-property-initializers.aspx) - [Expression bodied members](https://lostechies.com/jimmybogard/2015/12/17/c-6-feature-review-expression-bodied-function-members/) @@ -102,13 +102,13 @@ With versions 3 and 5, C# had added some pretty impressive stuff in an OO langua - [nameof operator](https://stackoverflow.com/questions/31695900/what-is-the-purpose-of-nameof) - [Dictionary initializer](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/how-to-initialize-a-dictionary-with-a-collection-initializer) -Taken individually, these are all cool language features. But if you look at them altogether, you see an interesting pattern. In this version, C# eliminated language boilerplate to make code more terse and readable. So for fans of clean, simple code, this language version was a huge win. +Each of these features is interesting in its own right. But if you look at them altogether, you see an interesting pattern. In this version, C# eliminated language boilerplate to make code more terse and readable. So for fans of clean, simple code, this language version was a huge win. -Oh, and they did do one other thing along with this version, though it's not a traditional language feature, per se. They released [Roslyn the compiler as a service](https://github.com/dotnet/roslyn). C# now uses C# to build C#, and they let you use the compiler as part of your programming efforts. +They did one other thing along with this version, though it's not a traditional language feature in itself. They released [Roslyn the compiler as a service](https://github.com/dotnet/roslyn). The C# compiler is now written in C#, and you can use the compiler as part of your programming efforts. -## C# Version 7 +## C# version 7.0 -Finally, we arrive at C# version 7. This has some evolutionary and cool stuff in the vein of C# 6, but without the compiler as a service. Here are some of the new features. +The most recent major version is C# version 7.0. This version has some evolutionary and cool stuff in the vein of C# 6.0, but without the compiler as a service. Here are some of the new features: - [Out variables](http://www.c-sharpcorner.com/article/out-variables-in-c-sharp-7-0/) - [Tuples and deconstruction](https://www.thomaslevesque.com/2016/08/23/tuple-deconstruction-in-c-7/) @@ -117,8 +117,8 @@ Finally, we arrive at C# version 7. This has some evolutionary and cool stuff i - [Expanded expression bodied members](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-7#more-expression-bodied-members) - [Ref locals and returns](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-7#ref-locals-and-returns) -All of these offer cool new capabilities for developers and the opportunity to write even cleaner code than ever. A highlight is condensing the declaration of variables to use with the `out` keyword and by allowing multiple return values via tuple. +All of these features offer cool new capabilities for developers and the opportunity to write even cleaner code than ever. A highlight is condensing the declaration of variables to use with the `out` keyword and by allowing multiple return values via tuple. -But C# is being put to ever broader use. .NET now targets any operating system and has its eyes firmly on the cloud and on portability. This certainly occupies the language designers' thoughts and time, in addition to coming up with new features. +But C# is being put to ever broader use. .NET Core now targets any operating system and has its eyes firmly on the cloud and on portability. This certainly occupies the language designers' thoughts and time, in addition to coming up with new features. _Article_ [_originally published on the NDepend blog_](https://blog.ndepend.com/c-versions-look-language-history/)_, courtesy of Erik Dietrich and Patrick Smacchia._ From e128d5322a8b79db415f2a67801f997a407a6428 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Wed, 13 Sep 2017 19:50:56 -0400 Subject: [PATCH 6/9] fix build warnings on links. --- docs/csharp/whats-new/csharp-version-history.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/csharp/whats-new/csharp-version-history.md b/docs/csharp/whats-new/csharp-version-history.md index 680fa03fb2ac7..7db91da13a6d2 100644 --- a/docs/csharp/whats-new/csharp-version-history.md +++ b/docs/csharp/whats-new/csharp-version-history.md @@ -27,12 +27,12 @@ C# version 1.0 looked stripped of features, compared to today. You'd find yourse Now things start to get interesting. Let's take a look at some major features of C# 2.0, released in 2005, along with Visual Studio 2005. -- [Generics](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/generics/) +- [Generics](../programming-guide/generics/) - [Partial types](https://www.dotnetperls.com/partial) - [Anonymous methods](https://www.tutorialspoint.com/csharp/csharp_anonymous_methods.htm) -- [Nullable types](./csharp/programming-guide/nullable-types/) +- [Nullable types](../programming-guide/nullable-types/) - [Iterators](https://msdn.microsoft.com/en-us/library/65zzykke(v=vs.100).aspx) -- [Covariance and contravariance](./programming-guide/concepts/covariance-contravariance/) +- [Covariance and contravariance](../programming-guide/concepts/covariance-contravariance/) While C# may have started as a pretty generic Object-Oriented (OO) language, C# Version 2.0 changed that in a hurry. Once they had their feet under them, they went after some serious developer pain points. And they went after them in a big way. From e9c79d358d3874b46f05326134ac36fda4ee2bac Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Tue, 19 Sep 2017 17:47:52 -0700 Subject: [PATCH 7/9] respond to feedback --- .../whats-new/csharp-version-history.md | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/docs/csharp/whats-new/csharp-version-history.md b/docs/csharp/whats-new/csharp-version-history.md index 7db91da13a6d2..fa3a40c218185 100644 --- a/docs/csharp/whats-new/csharp-version-history.md +++ b/docs/csharp/whats-new/csharp-version-history.md @@ -19,45 +19,45 @@ What did the language look like in its earliest incarnations? And how has it evo When you go back and look, C# version 1.0 looked a lot like Java. As [part of its stated design goals for ECMA](http://feeldotneteasy.blogspot.com/2011/01/c-design-goals.html), it sought to be a "simple, modern, general purpose object-oriented language." At the time, looking like Java meant it achieved those early design goals. -But if you look back on C# 1.0 now, you'd find yourself a little dizzy. It lacked the built-in async capabilities and some of the slick functionality around generics that we take for granted. As a matter of fact, it lacked generics altogether. And [LINQ](https://docs.microsoft.com/en-us/dotnet/csharp/linq/)? Not available yet. That would take some years to come out. +But if you look back on C# 1.0 now, you'd find yourself a little dizzy. It lacked the built-in async capabilities and some of the slick functionality around generics that we take for granted. As a matter of fact, it lacked generics altogether. And [LINQ](../linq/)? Not available yet. That would take some years to come out. C# version 1.0 looked stripped of features, compared to today. You'd find yourself writing some verbose code. But yet, you have to start somewhere. C# version 1.0 was a viable alternative to Java on the Windows platform. ## C# version 2.0 -Now things start to get interesting. Let's take a look at some major features of C# 2.0, released in 2005, along with Visual Studio 2005. +Now things start to get interesting. Let's take a look at some major features of C# 2.0, released in 2005, along with Visual Studio 2005: - [Generics](../programming-guide/generics/) -- [Partial types](https://www.dotnetperls.com/partial) -- [Anonymous methods](https://www.tutorialspoint.com/csharp/csharp_anonymous_methods.htm) +- [Partial types](../programming-guide/classes-and-structs/partial-classes-and-methods#partial-classes) +- [Anonymous methods](../programming-guide/statements-expressions-operators/anonymous-methods) - [Nullable types](../programming-guide/nullable-types/) -- [Iterators](https://msdn.microsoft.com/en-us/library/65zzykke(v=vs.100).aspx) +- [Iterators](../programming-guide/concepts/iterators) - [Covariance and contravariance](../programming-guide/concepts/covariance-contravariance/) -While C# may have started as a pretty generic Object-Oriented (OO) language, C# Version 2.0 changed that in a hurry. Once they had their feet under them, they went after some serious developer pain points. And they went after them in a big way. +While C# may have started as a pretty generic Object-Oriented (OO) language, C# version 2.0 changed that in a hurry. Once they had their feet under them, they went after some serious developer pain points. And they went after them in a big way. With generics, you have types and methods that can operate on an arbitrary type while still retaining type safety. So, for instance, having a lets you have `List` or `List` and perform type safe operations on those strings or integers while you iterate through them. This is better than creating `ListInt` inheritors or casting from `Object` for every operation. -C# Version 2.0 brought iterators. To put it succinctly, this lets you iterate through the items in a `List` (or other Enumerable types) with a `foreach` loop. Having this as a first class part of the language dramatically enhanced readability of the language and people's ability to reason about the code. +C# version 2.0 brought iterators. To put it succinctly, this lets you iterate through the items in a `List` (or other Enumerable types) with a `foreach` loop. Having this as a first-class part of the language dramatically enhanced readability of the language and people's ability to reason about the code. And yet, C# continued to play a bit of catch-up with Java. Java had already released versions that included generics and iterators. But that would soon change as the languages continued to evolve apart. ## C# version 3.0 -C# Version 3.0 came in late 2007, along with Visual Studio 2008, though the full boat of language features would actually come with C# Version 3.5. This version marked a major change in the growth of C#. It established C# as a truly formidable programming language. Let's take a look at some major features in this version. +C# version 3.0 came in late 2007, along with Visual Studio 2008, though the full boat of language features would actually come with C# version 3.5. This version marked a major change in the growth of C#. It established C# as a truly formidable programming language. Let's take a look at some major features in this version: -- [Auto implemented properties](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/auto-implemented-properties) -- [Anonymous types](http://www.c-sharpcorner.com/UploadFile/ff2f08/anonymous-types-in-C-Sharp/) -- [Query expressions](https://docs.microsoft.com/en-us/dotnet/csharp/linq/query-expression-basics) +- [Auto implemented properties](../programming-guide/classes-and-structs/auto-implemented-properties) +- [Anonymous types](../programming-guide/classes-and-structs/anonymous-types) +- [Query expressions](../linq/query-expression-basics) - [Lambda expression](https://www.daedtech.com/introduction-to-c-lambda-expressions/) - [Expression trees](https://blogs.msdn.microsoft.com/charlie/2008/01/31/expression-tree-basics/) - [Extension methods](https://www.codeproject.com/Tips/709310/Extension-Method-In-Csharp) In retrospect, many of these features seem both inevitable and inseparable. They all fit together strategically. It's generally thought that C# version's killer feature was the query expression, also known as Language-Integrated Query (LINQ). -A more nuanced view examines expression tress, lambda expressions, and anonymous types as the foundation upon which LINQ is constructed. But, in either case, C# 3.0 presented with a fairly revolutionary concept. C# 3.0 had begun to lay the groundwork for turning C# into a hybrid Object Oriented / Functional language. +A more nuanced view examines expression tress, lambda expressions, and anonymous types as the foundation upon which LINQ is constructed. But, in either case, C# 3.0 presented a revolutionary concept. C# 3.0 had begun to lay the groundwork for turning C# into a hybrid Object Oriented / Functional language. -Specifically, you could now write SQL-style, declarative queries to perform operations on collections, among other things. Instead of writing a `for` loop to compute the average of a list of integers, you could now do that as simply as `list.Average()`. The combination of query expressions and extension methods made it look as though that list of ints had gotten a whole lot smarter. +Specifically, you could now write SQL-style, declarative queries to perform operations on collections, among other things. Instead of writing a `for` loop to compute the average of a list of integers, you could now do that as simply as `list.Average()`. The combination of query expressions and extension methods made it look as though that list of integers had gotten a whole lot smarter. It took time for people to really grasp and integrate the concept, but they gradually did. And now, years later, code is much more concise, simple, and functional. @@ -65,11 +65,11 @@ It took time for people to really grasp and integrate the concept, but they grad C# Version 4.0 would have had a difficult time living up to the groundbreaking status of version 3.0. With version 3.0, C# had moved the language firmly out from the shadow of Java and into prominence. The language was quickly becoming elegant. -The next version did introduce some interesting new features. +The next version did introduce some interesting new features: -- [Dynamic binding](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/dynamic) -- [Named/optional arguments](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/named-and-optional-arguments) -- [Generic covariant and contravariant](https://docs.microsoft.com/en-us/dotnet/standard/generics/covariance-and-contravariance) +- [Dynamic binding](../language-reference/keywords/dynamic) +- [Named/optional arguments](../programming-guide/classes-and-structs/named-and-optional-arguments) +- [Generic covariant and contravariant](../../standard/generics/covariance-and-contravariance) - [Embedded interop types](https://stackoverflow.com/questions/20514240/whats-the-difference-setting-embed-interop-types-true-and-false-in-visual-studi) Embedded interop types alleviated a deployment pain. Generic covariance and contravariance give you more power to use generics, but they're a bit academic and probably most appreciated by framework and library authors. Named and optional parameters let you eliminate many method overloads and provide convenience. But none of those features are exactly paradigm altering. @@ -80,9 +80,9 @@ This gives you the potential for errors but also great power within the language ## C# version 5.0 -C# Version 5.0 was a very focused version of the language. Nearly all of the effort for that version went into another groundbreaking language concept. Here is the major features list. +C# Version 5.0 was a very focused version of the language. Nearly all of the effort for that version went into another groundbreaking language concept. Here is the major features list: -- [Asynchronous members](https://msdn.microsoft.com/library/hh191443(vs.110).aspx) +- [Asynchronous members](../async) - [Caller info attributes](https://www.codeproject.com/Tips/606379/Caller-Info-Attributes-in-Csharp) The caller info attribute lets you easily retrieve information about the context in which you're running without resorting to a ton of boilerplate reflection code. It has many uses in diagnostics and logging tasks. @@ -91,16 +91,16 @@ But `async` and `await` are the real stars of this release. When these features ## C# version 6.0 -With versions 3.0 and 5.0, C# had added some impressive features in an Object Oriented language. (Version 2.0 did as well, but it was fast following Java with those language features.) With version 6.0, it would go away from doing a dominant killer feature and instead release many features that delighted users of the language. Here are some of them. +With versions 3.0 and 5.0, C# had added some impressive features in an object oriented language. With version 6.0, it would go away from doing a dominant killer feature and instead release many features that delighted users of the language. Here are some of them: -- [Static imports](http://geekswithblogs.net/BlackRabbitCoder/archive/2015/04/16/c.net-little-wonders-static-using-statements-in-c-6.aspx) +- [Static imports](../language-reference/keywords/using-static) - [Exception filters](https://www.thomaslevesque.com/2015/06/21/exception-filters-in-c-6/) - [Property initializers](http://geekswithblogs.net/WinAZ/archive/2015/06/30/whatrsquos-new-in-c-6.0-auto-property-initializers.aspx) - [Expression bodied members](https://lostechies.com/jimmybogard/2015/12/17/c-6-feature-review-expression-bodied-function-members/) - [Null propagator](https://davefancher.com/2014/08/14/c-6-0-null-propagation-operator/) -- [String interpolation](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/interpolated-strings) +- [String interpolation](../language-reference/keywords/interpolated-strings) - [nameof operator](https://stackoverflow.com/questions/31695900/what-is-the-purpose-of-nameof) -- [Dictionary initializer](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/how-to-initialize-a-dictionary-with-a-collection-initializer) +- [Dictionary initializer](../csharp/programming-guide/classes-and-structs/how-to-initialize-a-dictionary-with-a-collection-initializer) Each of these features is interesting in its own right. But if you look at them altogether, you see an interesting pattern. In this version, C# eliminated language boilerplate to make code more terse and readable. So for fans of clean, simple code, this language version was a huge win. @@ -112,10 +112,10 @@ The most recent major version is C# version 7.0. This version has some evolution - [Out variables](http://www.c-sharpcorner.com/article/out-variables-in-c-sharp-7-0/) - [Tuples and deconstruction](https://www.thomaslevesque.com/2016/08/23/tuple-deconstruction-in-c-7/) -- [Pattern matching](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-7#pattern-matching) +- [Pattern matching](./csharp-7#pattern-matching) - [Local functions](http://www.infoworld.com/article/3182416/application-development/c-7-in-depth-exploring-local-functions.html) -- [Expanded expression bodied members](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-7#more-expression-bodied-members) -- [Ref locals and returns](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-7#ref-locals-and-returns) +- [Expanded expression bodied members](./csharp-7#more-expression-bodied-members) +- [Ref locals and returns](./csharp-7#ref-locals-and-returns) All of these features offer cool new capabilities for developers and the opportunity to write even cleaner code than ever. A highlight is condensing the declaration of variables to use with the `out` keyword and by allowing multiple return values via tuple. From 23d754509dc3e2601389ed1850d1adc87ecf3d10 Mon Sep 17 00:00:00 2001 From: Maira Wenzel Date: Wed, 20 Sep 2017 00:59:47 -0700 Subject: [PATCH 8/9] fixed build warnings --- .../whats-new/csharp-version-history.md | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/docs/csharp/whats-new/csharp-version-history.md b/docs/csharp/whats-new/csharp-version-history.md index fa3a40c218185..c0a491fc0812c 100644 --- a/docs/csharp/whats-new/csharp-version-history.md +++ b/docs/csharp/whats-new/csharp-version-history.md @@ -4,7 +4,7 @@ description: What did the language look like in its earliest versions, and how h keywords: C#, .NET, .NET Core, What's New, C# History author: erikdietrich ms.author: wiwagn -ms.date: 09/11/2017 +ms.date: 09/20/2017 ms.topic: article ms.prod: .net ms.technology: devlang-csharp @@ -19,7 +19,7 @@ What did the language look like in its earliest incarnations? And how has it evo When you go back and look, C# version 1.0 looked a lot like Java. As [part of its stated design goals for ECMA](http://feeldotneteasy.blogspot.com/2011/01/c-design-goals.html), it sought to be a "simple, modern, general purpose object-oriented language." At the time, looking like Java meant it achieved those early design goals. -But if you look back on C# 1.0 now, you'd find yourself a little dizzy. It lacked the built-in async capabilities and some of the slick functionality around generics that we take for granted. As a matter of fact, it lacked generics altogether. And [LINQ](../linq/)? Not available yet. That would take some years to come out. +But if you look back on C# 1.0 now, you'd find yourself a little dizzy. It lacked the built-in async capabilities and some of the slick functionality around generics that we take for granted. As a matter of fact, it lacked generics altogether. And [LINQ](../linq/index.md)? Not available yet. That would take some years to come out. C# version 1.0 looked stripped of features, compared to today. You'd find yourself writing some verbose code. But yet, you have to start somewhere. C# version 1.0 was a viable alternative to Java on the Windows platform. @@ -27,12 +27,12 @@ C# version 1.0 looked stripped of features, compared to today. You'd find yourse Now things start to get interesting. Let's take a look at some major features of C# 2.0, released in 2005, along with Visual Studio 2005: -- [Generics](../programming-guide/generics/) -- [Partial types](../programming-guide/classes-and-structs/partial-classes-and-methods#partial-classes) -- [Anonymous methods](../programming-guide/statements-expressions-operators/anonymous-methods) -- [Nullable types](../programming-guide/nullable-types/) -- [Iterators](../programming-guide/concepts/iterators) -- [Covariance and contravariance](../programming-guide/concepts/covariance-contravariance/) +- [Generics](../programming-guide/generics/index.md) +- [Partial types](../programming-guide/classes-and-structs/partial-classes-and-methods.md#partial-classes) +- [Anonymous methods](../programming-guide/statements-expressions-operators/anonymous-methods.md) +- [Nullable types](../programming-guide/nullable-types/index.md) +- [Iterators](../programming-guide/concepts/iterators.md) +- [Covariance and contravariance](../programming-guide/concepts/covariance-contravariance/index.md) While C# may have started as a pretty generic Object-Oriented (OO) language, C# version 2.0 changed that in a hurry. Once they had their feet under them, they went after some serious developer pain points. And they went after them in a big way. @@ -46,9 +46,9 @@ And yet, C# continued to play a bit of catch-up with Java. Java had already rele C# version 3.0 came in late 2007, along with Visual Studio 2008, though the full boat of language features would actually come with C# version 3.5. This version marked a major change in the growth of C#. It established C# as a truly formidable programming language. Let's take a look at some major features in this version: -- [Auto implemented properties](../programming-guide/classes-and-structs/auto-implemented-properties) -- [Anonymous types](../programming-guide/classes-and-structs/anonymous-types) -- [Query expressions](../linq/query-expression-basics) +- [Auto implemented properties](../programming-guide/classes-and-structs/auto-implemented-properties.md) +- [Anonymous types](../programming-guide/classes-and-structs/anonymous-types.md) +- [Query expressions](../linq/query-expression-basics.md) - [Lambda expression](https://www.daedtech.com/introduction-to-c-lambda-expressions/) - [Expression trees](https://blogs.msdn.microsoft.com/charlie/2008/01/31/expression-tree-basics/) - [Extension methods](https://www.codeproject.com/Tips/709310/Extension-Method-In-Csharp) @@ -67,9 +67,9 @@ C# Version 4.0 would have had a difficult time living up to the groundbreaking s The next version did introduce some interesting new features: -- [Dynamic binding](../language-reference/keywords/dynamic) -- [Named/optional arguments](../programming-guide/classes-and-structs/named-and-optional-arguments) -- [Generic covariant and contravariant](../../standard/generics/covariance-and-contravariance) +- [Dynamic binding](../language-reference/keywords/dynamic.md) +- [Named/optional arguments](../programming-guide/classes-and-structs/named-and-optional-arguments.md) +- [Generic covariant and contravariant](../../standard/generics/covariance-and-contravariance.md) - [Embedded interop types](https://stackoverflow.com/questions/20514240/whats-the-difference-setting-embed-interop-types-true-and-false-in-visual-studi) Embedded interop types alleviated a deployment pain. Generic covariance and contravariance give you more power to use generics, but they're a bit academic and probably most appreciated by framework and library authors. Named and optional parameters let you eliminate many method overloads and provide convenience. But none of those features are exactly paradigm altering. @@ -82,7 +82,7 @@ This gives you the potential for errors but also great power within the language C# Version 5.0 was a very focused version of the language. Nearly all of the effort for that version went into another groundbreaking language concept. Here is the major features list: -- [Asynchronous members](../async) +- [Asynchronous members](../async.md) - [Caller info attributes](https://www.codeproject.com/Tips/606379/Caller-Info-Attributes-in-Csharp) The caller info attribute lets you easily retrieve information about the context in which you're running without resorting to a ton of boilerplate reflection code. It has many uses in diagnostics and logging tasks. @@ -98,9 +98,9 @@ With versions 3.0 and 5.0, C# had added some impressive features in an object or - [Property initializers](http://geekswithblogs.net/WinAZ/archive/2015/06/30/whatrsquos-new-in-c-6.0-auto-property-initializers.aspx) - [Expression bodied members](https://lostechies.com/jimmybogard/2015/12/17/c-6-feature-review-expression-bodied-function-members/) - [Null propagator](https://davefancher.com/2014/08/14/c-6-0-null-propagation-operator/) -- [String interpolation](../language-reference/keywords/interpolated-strings) +- [String interpolation](../language-reference/keywords/interpolated-strings.md) - [nameof operator](https://stackoverflow.com/questions/31695900/what-is-the-purpose-of-nameof) -- [Dictionary initializer](../csharp/programming-guide/classes-and-structs/how-to-initialize-a-dictionary-with-a-collection-initializer) +- [Dictionary initializer](../programming-guide/classes-and-structs/how-to-initialize-a-dictionary-with-a-collection-initializer.md) Each of these features is interesting in its own right. But if you look at them altogether, you see an interesting pattern. In this version, C# eliminated language boilerplate to make code more terse and readable. So for fans of clean, simple code, this language version was a huge win. @@ -112,10 +112,10 @@ The most recent major version is C# version 7.0. This version has some evolution - [Out variables](http://www.c-sharpcorner.com/article/out-variables-in-c-sharp-7-0/) - [Tuples and deconstruction](https://www.thomaslevesque.com/2016/08/23/tuple-deconstruction-in-c-7/) -- [Pattern matching](./csharp-7#pattern-matching) +- [Pattern matching](./csharp-7.md#pattern-matching) - [Local functions](http://www.infoworld.com/article/3182416/application-development/c-7-in-depth-exploring-local-functions.html) -- [Expanded expression bodied members](./csharp-7#more-expression-bodied-members) -- [Ref locals and returns](./csharp-7#ref-locals-and-returns) +- [Expanded expression bodied members](./csharp-7.md#more-expression-bodied-members) +- [Ref locals and returns](./csharp-7.md#ref-locals-and-returns) All of these features offer cool new capabilities for developers and the opportunity to write even cleaner code than ever. A highlight is condensing the declaration of variables to use with the `out` keyword and by allowing multiple return values via tuple. From b5f56e76a78bd53e7fd2c868d651d49ed1bb3d4d Mon Sep 17 00:00:00 2001 From: Maira Wenzel Date: Wed, 20 Sep 2017 01:03:26 -0700 Subject: [PATCH 9/9] fixed version capitalization --- docs/csharp/whats-new/csharp-version-history.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/csharp/whats-new/csharp-version-history.md b/docs/csharp/whats-new/csharp-version-history.md index c0a491fc0812c..0472c8c6fcc99 100644 --- a/docs/csharp/whats-new/csharp-version-history.md +++ b/docs/csharp/whats-new/csharp-version-history.md @@ -63,7 +63,7 @@ It took time for people to really grasp and integrate the concept, but they grad ## C# version 4.0 -C# Version 4.0 would have had a difficult time living up to the groundbreaking status of version 3.0. With version 3.0, C# had moved the language firmly out from the shadow of Java and into prominence. The language was quickly becoming elegant. +C# version 4.0 would have had a difficult time living up to the groundbreaking status of version 3.0. With version 3.0, C# had moved the language firmly out from the shadow of Java and into prominence. The language was quickly becoming elegant. The next version did introduce some interesting new features: @@ -74,13 +74,13 @@ The next version did introduce some interesting new features: Embedded interop types alleviated a deployment pain. Generic covariance and contravariance give you more power to use generics, but they're a bit academic and probably most appreciated by framework and library authors. Named and optional parameters let you eliminate many method overloads and provide convenience. But none of those features are exactly paradigm altering. -The major feature was the introduction of the `dynamic` keyword. The `dynamic` keyword introduced into C# Version 4.0 the ability to override the compiler on compile-time typing. By using the dynamic keyword, you can create constructs similar to dynamically typed languages like JavaScript. You can create a `dynamic x = "a string"` and then add six to it, leaving it up to the runtime to sort out what should happen next. +The major feature was the introduction of the `dynamic` keyword. The `dynamic` keyword introduced into C# version 4.0 the ability to override the compiler on compile-time typing. By using the dynamic keyword, you can create constructs similar to dynamically typed languages like JavaScript. You can create a `dynamic x = "a string"` and then add six to it, leaving it up to the runtime to sort out what should happen next. This gives you the potential for errors but also great power within the language. ## C# version 5.0 -C# Version 5.0 was a very focused version of the language. Nearly all of the effort for that version went into another groundbreaking language concept. Here is the major features list: +C# version 5.0 was a very focused version of the language. Nearly all of the effort for that version went into another groundbreaking language concept. Here is the major features list: - [Asynchronous members](../async.md) - [Caller info attributes](https://www.codeproject.com/Tips/606379/Caller-Info-Attributes-in-Csharp)