What is C#?

Just what is C# and how is it different to .NET?

10,000 ft Overview

C# (pronounced “C Sharp”) is mixed paradigm programming language - focussing on both object-orientation and functional programming paradigms.

It was first created by Anders Hejlsberg (creator of Turbo Pascal and Delphi), and Mads Torgersen is the current lead designer of the language - Anders has moved on to working on TypeScript.

C# is one of two languages which are officially supported by .NET.

Beginner Information

C# is a programming language which is similar to most of the other C-family of programming languages (like C, C++, Java, etc.), and has a mixture of static and dynamic (or “duck”) typing (duck typing is supported using th dynamic type).

There are a lot of similarities between Java and C#, such as in the following code block (the canonical “Hello, World!” examples).

First, C#:

 1// this example intentionally uses the older style C# syntax)
 2using System;
 3
 4namespace HelloWorld
 5{
 6  public class MyClass
 7  {
 8    public static void Main(string[] args)
 9    {
10      Console.WriteLine("Hello, World!");
11    }
12  }
13}

And now, Java:

1public class Main {
2  public static void main(String[] args) {
3    System.out.println("Hello, World!");
4  }
5}

Intermediary Information

Advanced Information