<!-- Per Ecma, "C#" (i.e., not "C♯") is the standard spelling of the name of the language. See "Name" section and talk page. -->
C# ( ) is a general-purpose high-level programming language supporting multiple paradigms. C# encompasses static typing, strong typing, lexically scoped, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines.
Design goals
The Ecma standard lists these design goals for C#:
- The language is intended to be a simple, modern, general-purpose, object-oriented programming language.
- The language, and implementations thereof, should provide support for software engineering principles such as strong type checking, array bounds checking, detection of attempts to use uninitialized variables, and automatic garbage collection. Software robustness, durability, and programmer productivity are important.
- The language is intended for use in developing software components suitable for deployment in distributed environments.
- Portability is very important for source code and programmers, especially those already familiar with C and C++.
- Support for internationalization is very important.
- C# is intended to be suitable for writing applications for both hosted and embedded systems, ranging from the very large that use sophisticated operating systems, down to the very small having dedicated functions.
- Although C# applications are intended to be economical with regard to memory and processing power requirements, the language was not intended to compete directly on performance and size with C or assembly language.
History
During the development of the .NET Framework, the class libraries were originally written using a managed code compiler system named Simple Managed C (SMC). In January 1999, Anders Hejlsberg formed a team to build a new language at the time called COOL, which stood for "C-like Object Oriented Language".
Microsoft had considered keeping the name "COOL(C-like Object Oriented Language)" as the final name of the language, but chose not to do so for trademark reasons. By the time the .NET project was publicly announced at the July 2000 Professional Developers Conference, the language had been renamed C#, and the class libraries and ASP.NET runtime were ported to C#.
Hejlsberg was C#'s principal designer and lead architect at Microsoft, and had been previously involved with the design of Turbo Pascal, Embarcadero Delphi (formerly CodeGear Delphi, Inprise Delphi and Borland Delphi), and Visual J++. In interviews and technical papers, he has stated that flaws in most major programming languages (e.g. C++, Java, Delphi, and Smalltalk) drove the fundamentals of the Common Language Runtime (CLR), which, in turn, drove the design of the C# language.
James Gosling, who created the Java programming language in 1994, and Bill Joy, a co-founder of Sun Microsystems, the originator of Java, called C# an "imitation" of Java; Gosling further said: "[C# is] sort of Java with reliability, productivity and security deleted."
In July 2000, Hejlsberg said that C# is "not a Java clone" and is "much closer to C++" in its design.
Since the release of C# 2.0 in November 2005, the C# and Java languages have evolved on increasingly divergent trajectories, becoming two quite different languages. One of the first major departures came with the addition of generics to both languages, with vastly different implementations. C# uses reification to provide "first-class" generic objects that can be used like any other class, with code generation performed at class-load time.
C# has also added several major features to accommodate functional-style programming, culminating in the LINQ extensions released with C# 3.0 and its supporting framework of lambda expressions, extension methods, and anonymous types. These features enable C# programmers to use functional programming techniques, such as closures, when it is advantageous to their application. The LINQ extensions and the functional imports help developers reduce the amount of boilerplate code included in common tasks such as querying a database, parsing an XML file, or searching through a data structure, shifting the emphasis onto the actual program logic to help improve readability and maintainability.
C# used to have a mascot called Andy (named after Anders Hejlsberg). It was retired on January 29, 2004.
C# was originally submitted to the ISO/IEC JTC 1 subcommittee SC 22 for review, under ISO/IEC 23270:2003, was withdrawn and was then approved under ISO/IEC 23270:2006. The 23270:2006 is withdrawn under 23270:2018 and approved with this version.
Name
Microsoft first used the name C# in 1988 for a variant of the C language designed for incremental compilation. That project was not completed, and the name was later reused.
The name "C sharp" was inspired by the musical notation whereby a sharp symbol indicates that the written note should be made a semitone higher in pitch.
This is similar to the language name of C++, where "++" indicates that a variable should be incremented by 1 after being evaluated. The sharp symbol also resembles a ligature of four "+" symbols (in a two-by-two grid), further implying that the language is an increment of C++.
Due to technical limits of display (standard fonts, browsers, etc.), and most keyboard layouts lacking a sharp symbol (), the number sign () was chosen to approximate the sharp symbol in the written name of the programming language.
This convention is reflected in the ECMA-334 C# Language Specification. The original implementation of Eiffel for .NET was called Eiffel#, a name retired since the full Eiffel language is now supported. The suffix has also been used for libraries, such as Gtk# (a .NET wrapper for GTK and other GNOME libraries) and Cocoa# (a wrapper for Cocoa).
Versions
Development of the text for standards (beginning with C# 6) is done on GitHub. C# 7 was submitted to Ecma and approved in December 2023. As of January 2024, the standard for C# 8 is currently under development, referencing the approved language proposals.
{| class="wikitable"
|-
! scope="col" rowspan="2" | C#<br/>version
! scope="colgroup" colspan="3" | Language specification
! scope="col" rowspan="2" | Date
! scope="col" rowspan="2" | .NET
! scope="col" rowspan="2" | Visual Studio
|-
! scope="col" | Ecma
! scope="col" | ISO/IEC
! scope="col" | Microsoft
|-
| scope="row" | 1.0
| rowspan="2" | ECMA-334:2003, December 2002
| rowspan="2" | ISO/IEC 23270:2003, April 2003
| January 2002
| January 2002
| .NET Framework 1.0
| Visual Studio .NET 2002
|-
| scope="row" | 1.1<br/>1.2
| October 2003
| April 2003
|
| Visual Studio .NET 2003
|-
| scope="row" | 2.0
| ECMA-334:2006, June 2006
| ISO/IEC 23270:2006, September 2006
| September 2005
| November 2005
|
| Visual Studio 2005<br />Visual Studio 2008
|-
| scope="row" | 3.0
| colspan="2" rowspan="2"
| August 2007
| November 2007
|
