Description #
C# (pronounced “C-sharp”) is a modern, object-oriented programming language developed by Microsoft. It is designed for building secure, scalable applications on the .NET platform, including desktop apps, cloud services, mobile apps, and web applications.
History #
C# was introduced by Microsoft in 2000 as part of the .NET initiative, with Anders Hejlsberg as the lead architect. It was created to combine the power of C++ with the ease of Visual Basic, and to compete with Java. Since its release, C# has evolved through multiple versions, adding features like LINQ, async/await, records, and pattern matching. It remains one of the top languages for enterprise and cross-platform development.
Hello World Code #
using System;
class Program
{
static void Main()
{
Console.WriteLine("Hello, World!");
}
}
How to Run #
Option 1: Online
Option 2: Local
- Install .NET SDK
- Run in terminal:
dotnet new console -o HelloWorld
cd HelloWorld
dotnet run
Key Concepts #
- Compiled to Intermediate Language (IL)
- Object-oriented
- Runs on .NET runtime
- Supports LINQ and lambda expressions
- Strong static typing
- Asynchronous programming with async/await
- Garbage collection
- Windows Forms, WPF, and MAUI for UI
- Cross-platform with .NET Core/.NET 5+
- Used for enterprise, game dev (Unity), and mobile apps
Try It Online #
Fun Facts #
- C# was influenced by Java but introduced many unique features earlier, like LINQ.
- It’s the primary language used in Unity for game development.
- C# compiles into Intermediate Language (IL), not directly to machine code — the CLR handles execution.