10 minlesson

What is C#?

What is C#?

Welcome to C# Foundations! In this course, you'll learn the fundamentals of C#, a powerful and versatile programming language used by millions of developers worldwide.

Introduction to C#

C# (pronounced "C-sharp") is a modern, object-oriented programming language developed by Microsoft. It was created by Anders Hejlsberg and his team and first released in 2000 as part of the .NET framework.

Key Characteristics

  • Strongly typed: Variables must be declared with a specific type
  • Object-oriented: Built around the concept of objects and classes
  • Modern syntax: Clean, readable code structure similar to Java and C++
  • Memory managed: Automatic garbage collection handles memory allocation
  • Cross-platform: Runs on Windows, macOS, and Linux via .NET

The .NET Ecosystem

C# is the primary language for the .NET platform, which provides:

  • Base Class Library (BCL): Thousands of pre-built classes for common tasks
  • Common Language Runtime (CLR): Executes your C# code
  • NuGet: Package manager for third-party libraries
  • Cross-platform support: Build apps for any operating system

.NET Versions

  • .NET Framework: Original Windows-only version (legacy)
  • .NET Core: Cross-platform, open-source version
  • .NET 5+: Unified platform (current standard)

What Can You Build with C#?

C# is incredibly versatile. Here's what you can create:

Desktop Applications

Windows Forms and WPF applications for Windows, or cross-platform apps with .NET MAUI.

Web Applications

ASP.NET Core for building web APIs, MVC applications, and Blazor for interactive web UIs.

Mobile Apps

.NET MAUI and Xamarin for iOS and Android development.

Games

Unity, one of the most popular game engines, uses C# as its scripting language.

Cloud Services

Azure Functions, microservices, and cloud-native applications.

Why Learn C#?

  1. Industry demand: C# developers are highly sought after
  2. Career opportunities: Enterprise, gaming, web, and mobile development
  3. Strong community: Excellent documentation and support
  4. Microsoft backing: Continuous investment and improvement
  5. Transferable skills: Similar syntax to Java, JavaScript, and C++

A Simple C# Example

Here's what C# code looks like:

csharp
1// A simple C# program
2using System;
3
4class Program
5{
6 static void Main()
7 {
8 string message = "Hello, C#!";
9 Console.WriteLine(message);
10
11 int number = 42;
12 Console.WriteLine($"The answer is {number}");
13 }
14}

Don't worry if this looks unfamiliar – we'll break down every part of this syntax throughout the course.

Summary

In this lesson, you learned:

  • C# is a modern, object-oriented programming language created by Microsoft
  • It runs on the .NET platform, which provides cross-platform support
  • C# can be used for desktop, web, mobile, game, and cloud development
  • It has strong industry demand and excellent tooling

In the next lesson, we'll set up your development environment so you can start writing C# code!

What is C#? - Anko Academy