Lesson 1 of 62Beginner10 min
What Is C#?
By the end of this lesson
Describe what kind of language C# is and what that means for how you write it.
C# is a general-purpose programming language designed for building applications, from command-line tools to web services to mobile apps.
Three characteristics shape what it is like to work with, and each one has a practical consequence for you rather than being a label to memorise.
- Statically typed
- Every value has a type known before the program runs, and the compiler checks that your operations make sense. You will see errors while writing rather than while running, which is the cheapest time to see them.
- Object-oriented, but not exclusively
- You model your problem with types that own data and behaviour. C# also supports functional styles, and modern C# leans on them more than it used to. You are not forced into deep class hierarchies.
- Managed
- Memory is handled for you. You do not allocate and release it manually, which removes an entire category of bug that older languages are known for.
What people build with it
- Web APIs and web applications, using ASP.NET Core
- Background services and scheduled jobs
- Desktop applications for Windows
- Cross-platform mobile applications
- Cloud functions and containerised services
- Command-line tools
For Anvi's work, the most common use by far is the server side of a business application: an API that holds the business rules, talks to a database, and serves a web or mobile front end.
string[] regions = { "North", "South", "East" };
foreach (string region in regions)
{
Console.WriteLine($"Opening report for {region}");
}
Console.WriteLine($"{regions.Length} regions processed.");- No class or Main method is required for a simple program — modern C# allows top-level statements like this.
- Types are explicit: string[] is an array of text values.
- Anything more substantial will be organised into classes, which the OOP module covers.
Summary
- C# is statically typed, so mistakes surface at compile time rather than run time
- It supports object-oriented and functional styles without forcing either
- Memory is managed for you
- Its most common role in business software is the server-side application layer
Saved in this browser only.