Combine

Coding Combine

The Combine

Master the fundamentals of C# programming - variables, control flow, data structures, and object-oriented basics

5 Weeks
Select a week

What is C#?

An introduction to C#, the .NET ecosystem, and what you can build with the language

Topics

What is C#?

C# is a modern, object-oriented programming language developed by Microsoft as part of the .NET platform

Key Points

  • C# was created by Anders Hejlsberg at Microsoft and released in 2000
  • It is a statically typed, compiled language — types are checked before the program runs
  • C# runs on the .NET runtime (CLR), which handles memory and execution
  • The language is strongly influenced by Java and C++, but with modern additions
  • C# is continuously updated — as of 2024 it is on version 13

Interactive Code Examples

// The classic first program in C#
using System;

class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine("Hello, World!");
    }
}

// With top-level statements (C# 9+, no class/Main boilerplate needed)
Console.WriteLine("Hello, World!");

💡 Explanation: Every C# program starts execution in Main(). The using System; directive imports the System namespace, which contains Console. C# 9 introduced top-level statements so you can skip the class/Main boilerplate for simple programs.

C# vs Other Languages

C#

Statically typed, compiled to IL, runs on .NET CLR

When to use:

Enterprise apps, games (Unity), Windows desktop, ASP.NET web APIs

Example:

int x = 5; // type declared at compile time

JavaScript

Dynamically typed, interpreted, runs in browser/Node.js

When to use:

Web frontends, full-stack web with Node.js

Example:

let x = 5; // type inferred at runtime

Python

Dynamically typed, interpreted, concise syntax

When to use:

Data science, scripting, machine learning

Example:

x = 5 # no type declaration needed

Java

Statically typed, compiled to bytecode, runs on JVM

When to use:

Android development, enterprise backend services

Example:

int x = 5; // nearly identical to C#