Programming languages
C#
A modern object-oriented language of the .NET ecosystem: backends, desktop, Unity games.
What it is
Anders Hejlsberg created C# at Microsoft, with a first release alongside .NET Framework in 2002. It is statically typed and compiles to intermediate language (IL) that the .NET runtime executes.
Since 2014 the Roslyn compiler and the .NET platform are open source, and with .NET Core they are cross-platform: Windows, Linux, macOS. A new language version ships with .NET every year.
C# brought async / await (later borrowed by other languages), LINQ, pattern matching, records and nullable reference types. It is used in ASP.NET Core, Unity, MAUI and Azure.
Use it when
- Backends and APIs on ASP.NET Core, especially in Microsoft-oriented companies.
- Games on Unity.
- Enterprise desktop and internal systems on .NET.
- Integration with Azure and Windows.
Avoid it when
- The team and infrastructure are fully on another stack, with no reason to switch.
- Tiny scripts: Python or shell are quicker to write.
Key concepts
- async / await
- Asynchronous code in a sequential style built on
Task. - LINQ
- Queries over collections and databases right in the language:
Where,Select,GroupBy. - Record
- An immutable type with value equality, handy for DTOs.
- Nullable reference types
string?annotations that make the compiler warn about possible null.- Dependency injection
- A dependency container built into ASP.NET Core.
Example
Interview questions
1. How does a struct differ from a class?
A class is a reference type on the heap, a struct is a value type that gets copied. Structs suit small immutable data, classes suit objects with behavior and identity.
2. How does async / await work?
awaitsuspends the method without blocking a thread and returns control until the operation (for example I/O) finishes. The compiler turns the method into a state machine built onTask.3. What is LINQ?
A set of methods and syntax for querying data sequences. The same query can run over an in-memory collection or be translated to SQL through Entity Framework.
4. What do IDisposable and using do?
IDisposabledefines releasing unmanaged resources (files, connections). Ausingblock guaranteesDisposeis called even on an exception.
Related technologies
- .NETMicrosoft's cross-platform platform for C#, with ASP.NET Core for web and APIs.
- JavaA statically typed JVM language: the base of enterprise backends, Android and large systems.
- Microsoft AzureMicrosoft's cloud, most convenient for .NET, Windows environments and companies on Microsoft 365 and Entra ID.
Logos belong to their owners and are used for identification only. Icons: Simple Icons (CC0), Devicon (MIT).