Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
245 views17 pages

History of CSharp

C# is a modern programming language developed by Microsoft. It was first released in 2001 and has evolved significantly since with new features added in each version. C# is commonly used for developing Windows, web, and game applications and is a popular language for teaching programming.

Uploaded by

Hamza Yare
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
245 views17 pages

History of CSharp

C# is a modern programming language developed by Microsoft. It was first released in 2001 and has evolved significantly since with new features added in each version. C# is commonly used for developing Windows, web, and game applications and is a popular language for teaching programming.

Uploaded by

Hamza Yare
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

HISTORY OF C#

C# (pronounced "C sharp") is a modern, versatile, and widely-used programming language


developed by Microsoft. It is part of the Microsoft .NET framework and is commonly used for
developing Windows applications, web applications, games, and more. It was first announced on
July 5, 2000, and was released in 2001 along with the .NET Framework 1.0. C# was designed to
be a modern, object-oriented language that was both easy to learn and use. It was also designed to
be interoperable with other languages, such as C++ and Java.

C# was created by Anders Hejlsberg, who is also the creator of Turbo Pascal, Delphi, and
TypeScript. Hejlsberg was inspired by the success of Java, but he also wanted to create a
language that was more modern and had better support for object-oriented programming.

C# is a statically typed language, which means that the types of variables must be declared before
they are used. This helps to prevent errors and makes the code more readable. C# is also a
strongly typed language, which means that the compiler will check to make sure that the types of
variables are compatible with each other before the code is executed. This helps to prevent
runtime errors.

C# is a high-level language, which means that it is closer to human language than to machine
language. This makes the code easier to write and read. C# is also a compiled language, which
means that the code is converted into machine language before it is executed. This makes the
code run faster than interpreted languages, such as Python and JavaScript.

C# is a general-purpose language, which means that it can be used to develop a wide variety of
applications, including desktop applications, web applications, mobile applications, and games.
C# is also a popular language for teaching programming, as it is relatively easy to learn and use.

C# has evolved significantly since its initial release. New features have been added in each
version, and the language has become more powerful and expressive. The current version of C#
is 11, and it was released in 2022.

1. C# version 1.0

Released January, 2002

When you go back and look, C# version 1.0, released with Visual Studio .NET 2002, looked a lot
like Java. As part of its stated design goals for ECMA, 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.

- C# 1.0 featured the core syntax and features of the language, including classes, interfaces,
inheritance, operations and expressions, statements and garbage collection.

- It also introduced the Common Language Runtime (CLR), which allowed C# code to be
compiled into Intermediate Language (IL) code and executed on the CLR, making it a key part of
the .NET Framework.

Example Code:

// Basic class and method

using System;

class HelloWorld

static void Main()

Console.WriteLine("Hello, World!");

}}

C# version 1.2

Released April, 2003

C# version 1.2 shipped with Visual Studio .NET 2003. It contained a few small enhancements to
the language. Most notable is that starting with this version, the code generated in a foreach loop
called Dispose on an IEnumerator when that IEnumerator implemented IDisposable.

C# version 2.0

Released November, 2005

- C# 2.0 brought several important enhancements, including:


- Generics: This feature allowed developers to create type-safe, reusable data structures and
algorithms.

- Anonymous methods: Introduced the ability to create unnamed delegate methods for handling
events and callbacks.

- Nullable value types: Enabled value types (e.g., int, float) to be assigned a null value.

- Iterators: Simplified the creation of custom iterators using the `yield` keyword.

- Partial classes: Allowed a class to be split into multiple files, making it easier to manage large
classes.

Example Code:

// Generics

using System;

using System.Collections.Generic;

class GenericList<T>

private List<T> list = new List<T>();

public void Add(T input)

list.Add(input);

public T this[int index]

get { return list[index]; }

set { list.Insert(index, value); }

}}
C# version 3.0

Released November, 2007

C# version 3.0 came in late 2007, along with Visual Studio 2008, though the full boat of
language features would actually come with .NET Framework 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:

- LINQ (Language Integrated Query): A powerful query language for querying data from
various sources, including databases and collections.

- Lambda expressions: Simplified the creation of anonymous functions.

- Implicitly typed variables (var): Allowed the compiler to infer the data type of a variable.

- Automatic properties: Simplified property declaration syntax by generating the backing field
automatically.

- Extension methods: Enabled adding new methods to existing types without modifying the
original type.

Example Code:

// LINQ

using System;

using System.Linq;

class LINQExample

static void Main()

int[] numbers = { 1, 2, 3, 4, 5 };

var query = from num in numbers

where num % 2 == 0
select num;

foreach (var num in query)

Console.WriteLine(num);

}}}

C# version 4.0

Released April, 2010

C# version 4.0, released with Visual Studio 2010, would have had a difficult time living up to the
groundbreaking status of version 3.0. This version introduced some interesting new features:

- Dynamic types (dynamic keyword): Allowed the use of late binding and simplified
interoperation with dynamic languages.

- Named and optional arguments: Improved method call readability and provided flexibility in
specifying arguments.

- Covariance and contravariance: Allowed more flexible type conversions for interfaces and
delegate types.

Example Code:

// Dynamic types

using System;

class DynamicExample

static void Main()

dynamic dynamicVar = 10;

Console.WriteLine(dynamicVar); // Prints 10

dynamicVar = "Hello";
Console.WriteLine(dynamicVar); // Prints Hello

}}

C# version 5.0

Released August, 2012

C# version 5.0, released with Visual Studio 2012, was a focused version of the language. Nearly
all of the effort for that version went into another groundbreaking language concept:
the async and await model for asynchronous programming. Here's the major features list:

- Async/await: Introduced asynchronous programming to simplify handling asynchronous


operations without blocking the main thread.

- Caller information attributes: Provided metadata about the caller's code location.

Example Code:

// Async/await

using System;

using System.Threading.Tasks;

class AsyncExample

static async Task Main()

await Task.Delay(1000);

Console.WriteLine("Async operation completed.");

}}

C# version 6.0

Released July, 2015

Version 6.0, released with Visual Studio 2015, released many smaller features that made C#
programming more productive. Here are some of them:
- String interpolation: Simplified string formatting with the `$` character.

- Null-conditional operators (?. and ?[]): Improved null checking in expressions.

- Expression-bodied members: Allowed simple methods, properties, and indexers to be


expressed using a concise syntax.

- Auto-property initializers: Enabled setting default values for auto-implemented properties.

Example Code:

// String interpolation

using System;

class InterpolationExample

static void Main()

string name = "Alice";

int age = 30;

Console.WriteLine($"My name is {name} and I am {age} years old.");

}}

C# version 7.0

Released March, 2017

C# version 7.0 was released with Visual Studio 2017. This version has some evolutionary and
cool stuff in the vein of C# 6.0. Here are some of the new features:

- Tuples: Provided a language-level tuple type for returning multiple values from a method.

- Pattern matching: Enhanced support for pattern matching in switch statements and
expressions.
- Local functions: Allowed nested functions within methods.

Example Code:

// Tuples

using System;

class TupleExample

static void Main()

var person = (Name: "John", Age: 25);

Console.WriteLine($"Name: {person.Name}, Age: {person.Age}");

}}

C# version 7.1

Released August, 2017

C# started releasing point releases with C# 7.1. This version added the language version
selection configuration element, three new language features, and new compiler behavior.

The new language features in this release are:

async Main method

The entry point for an application can have the async modifier.

default literal expressions

You can use default literal expressions in default value expressions when the target type can be
inferred.

Inferred tuple element names


The names of tuple elements can be inferred from tuple initialization in many cases.

Pattern matching on generic type parameters

You can use pattern match expressions on variables whose type is a generic type parameter.

Finally, the compiler has two options -refout and -refonly that control reference assembly
generation

C# version 7.2

Released November, 2017

C# 7.2 added several small language features:

Initializers on stackalloc arrays.

Use fixed statements with any type that supports a pattern.

Access fixed fields without pinning.

Reassign ref local variables.

Declare readonly struct types, to indicate that a struct is immutable and should be passed as
an in parameter to its member methods.

Add the in modifier on parameters, to specify that an argument is passed by reference but not
modified by the called method.

Use the ref readonly modifier on method returns, to indicate that a method returns its value by
reference but doesn't allow writes to that object.
Declare ref struct types, to indicate that a struct type accesses managed memory directly and must
always be stack allocated.

Use additional generic constraints.

Non-trailing named arguments

Named arguments can be followed by positional arguments.

Leading underscores in numeric literals

Numeric literals can now have leading underscores before any printed digits.

private protected access modifier

The private protected access modifier enables access for derived classes in the same assembly.

Conditional ref expressions

The result of a conditional expression (?:) can now be a reference.

C# version 7.3

Released May, 2018

There are two main themes to the C# 7.3 release. One theme provides features that enable safe
code to be as performant as unsafe code. The second theme provides incremental improvements
to existing features. New compiler options were also added in this release.

The following new features support the theme of better performance for safe code:

You can access fixed fields without pinning.

You can reassign ref local variables.


You can use initializers on stackalloc arrays.

You can use fixed statements with any type that supports a pattern.

You can use more generic constraints.

The following enhancements were made to existing features:

You can test == and != with tuple types.

You can use expression variables in more locations.

You may attach attributes to the backing field of auto-implemented properties.

Method resolution when arguments differ by in has been improved.

Overload resolution now has fewer ambiguous cases.

The new compiler options are:

-publicsign to enable Open Source Software (OSS) signing of assemblies.

-pathmap to provide a mapping for source directories.

- These minor updates brought several small language enhancements, performance


improvements, and compiler optimizations.

C# version 8.0

Released September, 2019

C# 8.0 is the first major C# release that specifically targets .NET Core. Some features rely on
new CLR capabilities, others on library types added only in .NET Core. C# 8.0 adds the
following features and enhancements to the C# language:

- Nullable reference types: Enhanced null safety by allowing developers to annotate reference
types as nullable or non-nullable.
- Async streams: Enabled asynchronous iteration over data streams.

- Default interface methods: Allowed the addition of new methods to existing interfaces
without breaking compatibility.

Example Code:

// Nullable reference types

#nullable enable

using System;

class NullableReferenceExample

static void Main()

string? name = null; // Nullable reference type

Console.WriteLine(name.Length); // Warning: Possible null reference

}}

C# version 9

Released November, 2020

C# 9 was released with .NET 5. It's the default language version for any assembly that targets
the .NET 5 release. It contains the following new and enhanced features:

- Records: Introduced a simplified syntax for creating immutable classes.

- Pattern matching enhancements: Enhanced pattern matching capabilities with new features.

- Top-level programs: Simplified the entry point for C# programs by allowing code outside of
a class.
- Improved target typing: Enhanced type inference in various scenarios.

Example Code:

// Records

using System;

record Person(string FirstName, string LastName);

class RecordsExample

static void Main()

var person1 = new Person("John", "Doe");

var person2 = new Person("John", "Doe");

Console.WriteLine(person1 == person2); // True (structural equality)

}}

11. C# 10.0 (November 2021):

- Global using directives: Global using directives allow you to specify using directives that
apply to all files in a project.

- Interpolated strings as format strings: Interpolated strings can now be used as format strings
for other strings.

- File-scoped namespaces: File-scoped namespaces allow you to define namespaces that are only
accessible within the file in which they are defined.

Example Code:

string name = "Bob";

// This line will print "Hello, Bob!"


string greeting = $"Hello, {name}!";
// This line is also valid

string greeting2 = $"Hello, {name:F}".format(name);

C# version 11

Released November, 2022

C# 11 introduces generic math and several features that support that goal. You can write numeric
algorithms once for all number types. There's more features to make working with struct types
easier, like required members and auto-default structs. Working with strings gets easier with Raw
string literals, newline in string interpolations, and UTF-8 string literals. Features like file local
types enable source generators to be simpler. Finally, list patterns add more support for pattern
matching.

Example Code:

public static class MathHelper

public static T Add<T>(T a, T b) where T : struct, IComparable

return a + b; }

public static T Subtract<T>(T a, T b) where T : struct, IComparable

return a - b;}

public static T Multiply<T>(T a, T b) where T : struct, IComparable

return a * b;}

public static T Divide<T>(T a, T b) where T : struct, IComparable

return a / b;}}
public class MyClass

public static void Main()

int x = 10;

int y = 20;

// Call the generic math methods

int sum = MathHelper.Add(x, y);

int difference = MathHelper.Subtract(x, y);

int product = MathHelper.Multiply(x, y);

int quotient = MathHelper.Divide(x, y);

// Print the results

Console.WriteLine($"Sum: {sum}");

Console.WriteLine($"Difference: {difference}");

Console.WriteLine($"Product: {product}");

Console.WriteLine($"Quotient: {quotient}");

}}
THE HISTORY OF .NET FRAMEWORK
The .NET Framework, developed by Microsoft, has a rich history that spans over two decades. It
was designed to provide a platform for building and running various types of software
applications on Windows

1. Initial Development (Late 1990s - Early 2000s):

In the late 1990s, Microsoft recognized the need for a more modern and consistent way of
building Windows applications. Development on the .NET Framework began under the
codename "Next Generation Windows Services" (NGWS). The first official version, .NET
Framework 1.0, was released in February 2002 alongside Visual Studio .NET.

VERSION UPDATES:

 .NET Framework 1.1 (April 2003): Introduced improvements and bug fixes,
including enhanced support for ASP.NET.
 .NET Framework 2.0 (November 2005): Brought significant enhancements like a
new 64-bit runtime, generics support, and improved ASP.NET features.
 .NET Framework 3.0 (November 2006): Introduced Windows Presentation
Foundation (WPF), Windows Communication Foundation (WCF), Windows
Workflow Foundation (WF), and Cardspace.
 .NET Framework 3.5 (November 2007): Added LINQ (Language Integrated
Query) and improved ASP.NET features.
 .NET Framework 4.0 (April 2010): Introduced parallel computing support with the
Task Parallel Library (TPL) and support for dynamic languages.
 .NET Framework 4.5 (August 2012): Included performance improvements, the
Async/Await pattern, and support for Windows Store apps.
 .NET Framework 4.6 (July 2015): Provided bug fixes and enhancements,
including improved support for HTTP/2 and new APIs.
 .NET Framework 4.7 (April 2017): Included performance and reliability
improvements.

EVOLUTION INTO .NET CORE:

 As technology evolved and the need for cross-platform development grew,


Microsoft introduced .NET Core in June 2016.
 .NET Core was designed to be open-source, cross-platform, and modular, catering to
a broader range of application development needs.

.NET CORE VERSION UPDATES:


 .NET Core 1.0 (June 2016): .NET Core marked a significant departure from the
traditional .NET Framework. It was open-source and cross-platform, making it possible to
develop .NET applications on Windows, Linux, and macOS.
 .NET Core 1.1 (November 2016): This update brought minor improvements and bug
fixes.
 .NET Core 2.0 (August 2017): It included performance enhancements, new APIs, and
improved compatibility with .NET Framework.
 .NET Core 2.1 (May 2018): This version focused on performance and improved features
for building cloud-based applications.
 .NET Core 2.2 (December 2018): It added new features and improved the stability of the
platform.
 .NET Core 3.0 (September 2019): .NET Core 3.0 introduced support for Windows
Desktop applications (WinForms and WPF) and improved performance.
 .NET Core 3.1 (December 2019): This was a long-term support (LTS) release with bug
fixes and stability improvements.
 .NET 5 (May 2020): This was a long-term support (LTS) release with bug fixes and
stability improvements.
 .NET 6 (September 2023): This was a long-term support (LTS) release with bug fixes and
stability improvements.
 .NET 7 (September 2023): This was a Standard-term support (STS)

You might also like