C# Guide: .NET Apps, Classes, Packages, and Backend Patterns

Published Updated

C# is the statically typed language behind .NET, and it runs web backends, Unity games, and a great deal of Windows software.

The frameworks that run on C#, such as ASP.NET Core and Entity Framework Core, have their own guide one level down, because a framework is a separate thing from the language it is written in. Every section below ends with a pointer to where the detail lives.

What Is C#, in Plain Words?

C# is a programming language that Microsoft created for the .NET platform. Microsoft's own tour describes it as a cross-platform, general purpose language based on object-oriented principles, in the C family, so its syntax is familiar to anyone who has seen C, JavaScript, TypeScript, or Java. It calls C# the most popular language for .NET, a free, cross-platform, open source development environment.

A statically typed language knows the type of every variable before the program runs, so the compiler or your editor can tell you when you use one wrongly. A runtime is the software that executes your compiled program, and for C# that runtime is .NET. A package is a library someone else wrote that your project downloads, and for C# the packages come from NuGet.

C# is compiled, though not straight to machine code. The compiler produces an intermediate form, and the runtime turns that into native code as the program runs, which is why one build runs on several operating systems. The runtime's source is public, and its repository states the MIT licence, which matters to anyone who prefers to read what they run.

What Is C# Used For, and Where Does It Fit?

Reach for C# when you want a fast, typed language with first-class tooling and one vendor-backed platform behind it. Each job in the table below names the part of the platform that does the work, because C# on its own is only the language.

The jobWhat does the workWhere it runs
Web backends and APIsASP.NET Core, with Entity Framework Core for dataLinux containers or Windows servers
GamesUnity, whose scripts are written in C#Wherever the game engine ships
Windows desktop softwareWPF, a Windows-only UI frameworkWindows only
Mobile and cross-platform desktop apps.NET MAUI, one code base for several platformsAndroid, iOS, macOS, and Windows
Small tools and scriptsFile-based apps, new with .NET 10Anywhere .NET 10 is installed

Microsoft's documentation says C# programs run on devices from Internet of Things hardware to the cloud, and that you can write apps for phones, desktop computers, and servers. The strongest default for a new backend is a small ASP.NET Core service, which the frameworks guide walks through.

Who Uses C#, and Why?

The 2025 Stack Overflow Developer Survey puts C# at 27.8 percent of all respondents and 29.9 percent of professional developers, and ASP.NET Core at 19.7 percent of all respondents among web technologies. In the same survey Express was used by 19.9 percent, so the two backend frameworks sit level. The language has been steady across three years: 27.62 percent in 2023, 27.1 percent in 2024, and 27.8 percent in 2025.

Stack Overflow's engineering blog says its public platform runs on .NET, with some older applications still on the full .NET Framework that it chose to run on a Windows Kubernetes cluster instead of upgrading before its deadline. Unity's manual says scripts in its engine use C# code, which makes C# the working language of a large number of game developers. Microsoft says most of the .NET runtime and libraries are written in C# itself.

WhoWhat they say they use it for
Stack OverflowIts public platform on .NET, some applications still on .NET Framework
Unity developersGame scripts, written as C# code
MicrosoftThe runtime and libraries, most of them in C#

The reasons behind them are consistent: strong tooling, one vendor behind the platform, and a language that suits both servers and game engines.

Where Did C# Come From, and Is It Still Growing?

C# began as Microsoft's language for the original .NET Framework, which was Windows-only. That history shapes what you will find online: a large body of tutorials written for the Windows-only platform, and a newer cross-platform .NET that new work targets. Microsoft's documentation treats .NET Framework as a Windows operating system component, so it is supported without being where new work starts. The old advice section below shows how to tell the two apart.

The current platform moves on a yearly rhythm. Microsoft's support page lists .NET 10 as a long-term-support release supported until November 2028, and .NET 8 and .NET 9 as supported until November 2026. The language version tracks the platform, so C# 14 ships with .NET 10 and the C# 14 notes list features such as extension members and the field keyword in properties.

On growth, the survey line is flat rather than rising, which I read as a mature language holding its ground. Platform support matters more to that picture than language fashion, and Microsoft's published support dates give a new project a clear runway.

Is C# Only for Windows and Microsoft Shops?

No. The .NET runtime is cross-platform, its repository uses the MIT licence, and Microsoft describes it as a runtime for cloud, mobile, desktop, and IoT apps. A C# service deploys to a Linux container as readily as to Windows. Specific UI technology stays tied to Windows. WPF is documented as Windows-only even on modern .NET.

What I like about this arrangement is that I can read the licence, choose the servers the runtime runs on, and keep the build files in plain text. The cost is that the platform has one dominant vendor, so a team should be comfortable following Microsoft's release and support calendar. The table sets out the platform split.

PlatformRuns onWhere new work starts
.NET (formerly .NET Core)Windows, macOS, and LinuxYes, this is the current platform
.NET FrameworkWindows onlyNo, it is for existing applications
WPFWindows onlyWhen the product is a Windows desktop application
.NET MAUIAndroid, iOS, macOS, and WindowsWhen one code base must cover several devices

C# or Java?

The two languages are close relatives and the choice rarely turns on language features. Both are statically typed, garbage-collected, and C-family, so the syntax looks alike, and both are mature and widely used. What separates them is the runtime, the owner, and the ecosystem you inherit with each. Pick the one your team already operates, and for a team with no history in either, pick C# when Unity or Windows desktop work is on the horizon.

QuestionC#Java
Runtime and owner.NET, backed by Microsoft, under the MIT licenceThe JVM, with OpenJDK under GPLv2 plus the Classpath Exception
Latest release todayC# 14 with .NET 10, supported until November 2028JDK 27, generally available on 15 September 2026
Survey usage, 2025 (all, professionals)27.8 and 29.9 percent29.4 and 29.6 percent

The survey rows show how close the pair is. Java led C# among professionals by 1.33 points in 2023 and by 1.2 points in 2024, and C# edged ahead by 0.3 points in 2025, a gap too small to rank on. The FAQ answer on C# and Java covers the basics until then.

C# or TypeScript for a Backend?

TypeScript on Node.js and C# on ASP.NET Core can both run a serious backend, and the Stack Overflow survey records them in a close contest: ASP.NET Core was used by 19.7 percent of all respondents in 2025, and Express by 19.9 percent. The main difference is where type checking happens. Node.js can now run TypeScript files by stripping the types, and its documentation states that no type checking is performed when it does, so checking remains a separate step. In C# the compiler checks types every time you build.

QuestionC# on ASP.NET CoreTypeScript on Node.js
Type checkingDone by the compiler on every buildA separate step; Node itself strips types without checking them
Code shared with the browserNot by defaultTypes and logic can be shared
PackagesNuGetnpm
Framework choiceOne mature default, with EF Core for dataMany options, assembled by the team
Time to learnThe class library takes timeGentle for anyone who already writes JavaScript

Choose C# when the backend is the product, several developers will maintain it for years, and you want one framework and compiler checks you cannot forget to run. Choose TypeScript when the browser and the server share code and the team already writes it. The TypeScript guide and the JavaScript guide cover the other side.

How Hard Is C# to Learn, and Do Agents Change That?

The syntax is approachable, and Microsoft's tour says C# is approachable for beginners while offering advanced features later. Starting is easier than it used to be, because .NET 10 added file-based apps, in which a single file runs without a project around it. The harder part is the .NET class library, which is large, and the framework layer on top of it.

// hello-world.cs, run with: dotnet run hello-world.cs
Console.WriteLine("Hello, World!");

With the .NET 10 SDK installed, that command prints Hello, World! The language order below makes framework code read like ordinary classes.

  1. Value and reference types, variables, and constants, so assignment behaves as expected.
  2. Nullable value and reference types, so missing data is explicit.
  3. Collections such as lists, dictionaries, and arrays.
  4. Classes, properties, constructors, and creating objects.
  5. Inheritance and interfaces, leaning on interfaces for flexible design.
  6. Methods, overloading, and optional and named arguments.
  7. LINQ and async with await once the fundamentals are comfortable.
  8. ASP.NET Core, EF Core, and the wider .NET stack.

Agents change the cost of typing and help most where the language is strict. Microsoft's tour says every variable has a type known at compile time and that the compiler or editing tools report incorrect use before you run the program, so an agent that misuses a type produces a build error and not a production surprise. In the 2025 Stack Overflow survey 66 percent of respondents named solutions that are almost right, but not quite, as their biggest frustration with AI tools, and a compiler catches only part of that gap.

An agent with terminal access can run dotnet build and dotnet test and read the complaints, which is a useful feedback loop. Nullable reference types add compile-time warnings about missing data, though a forced ! can still let a null through at run time, so read the diff. Treat the agent as a contractor with a narrow task, as the terminal AI agents guide advises, and prefer an open agent such as OpenCode if you want to choose the model yourself.

Is Old C# Advice Safe to Follow?

Often it is, but the age of a tutorial matters more in C# than the language suggests. A large body of material was written for .NET Framework, which is still supported as a Windows component yet is no longer where new work starts, so following it can leave you with habits that do not fit the platform you are on.

The old shapeWhat to know
System.Web and Web FormsThese never moved to modern .NET, so the code needs rewriting against a different framework
IIS configurationIIS is not the tell, since ASP.NET Core supports IIS hosting as a first-class option
A new HttpClient per requestCreating and disposing one per request can run a service out of ports under load; use a long-lived client or IHttpClientFactory
ConfigureAwait(false) after every awaitMostly unnecessary in ASP.NET Core application code, though still useful in libraries
A Program class with static void MainStill valid, though current C# lets a project start with top-level statements

The reliable tell is the API itself, and not the hosting. Look for System.Web or Web Forms before deciding that a tutorial is stale. The frameworks guide covers the modern request pipeline, package choices, and deployment that these decisions sit inside.

What Does C# Not Do Well?

C# does not give you a Windows-only UI on other systems, since WPF stays on Windows even on modern .NET. It builds iOS and macOS apps through .NET MAUI, but Microsoft's documentation states that building those requires a Mac. Startup time can matter for short-lived command-line tools and serverless functions, where ahead-of-time compilation produces a native binary with a much faster start at the cost of a larger build and limits on reflection-heavy libraries.

It also asks you to learn a platform and not only a language. If you are coming from another typed language, the .NET class library is the part that takes time, more than the syntax. A page in a browser still runs JavaScript, so interactivity belongs to the front end however the server is written.

Which Guides Cover the Framework Side of C#?

This site's C# guides start at the framework level. For the language itself, the Microsoft tour of C# and its beginner tutorials are the best companion.

C# is the right starting point when a mature, vendor-backed platform and strong tooling fit the team. Each language below answers a different need, and each guide says where it fits.

  • Go suits a lighter backend language with simpler deployment.
  • Rust suits work where memory control matters most.
  • Swift suits Apple platforms.
  • TypeScript suits teams that want one language across browser and server.
  • SQL covers the databases an EF Core application talks to, and the SQL hub explains which database to start with.

Frequently Asked Questions

What is the difference between .NET Framework and .NET?

.NET Framework is the original Windows-only runtime, which Microsoft's documentation treats as a Windows operating system component. .NET, formerly .NET Core, is the current cross-platform runtime that new C# work targets, and it is what the platform means today.

What is a NuGet package?

The package format and package manager for .NET, filling the role npm fills for Node or pip for Python. A project declares the packages it needs and the tooling downloads them and wires up the references.

Are C# and Java the same language?

They are separate languages, although both are statically typed, garbage-collected and C-family, which makes the syntax look alike, but they run on different runtimes, have different owners, and have diverged considerably in language features since they appeared.

What is the difference between a struct and a class?

A struct is a value type, typically stack-allocated and copied whenever it is assigned or passed. A class is a reference type on the heap, so assigning one variable to another shares the same object rather than copying it.

Is C# compiled or interpreted?

Compiled, though not straight to machine code. The compiler produces intermediate language, and the runtime's just-in-time compiler turns that into native code as the program runs. Ahead-of-time native compilation is available where startup time matters.

Can C# run on Linux and macOS?

It can, because the .NET runtime is cross-platform and open source under the MIT licence, so a C# service deploys to Linux containers as readily as it runs on Windows. Some UI frameworks remain Windows-only, including WPF, so the answer depends on the kind of application.

Which .NET version should a new project use?

Use .NET 10, the long-term-support release that Microsoft lists as supported until November 2028. Both .NET 8 and .NET 9 reach the end of their support in November 2026, so an application still on either should plan its upgrade soon.

Do I need Visual Studio to write C#?

You do not need it, because Microsoft's own tour names Visual Studio and Visual Studio Code with the C# Dev Kit as the main editors, and the dotnet command line in the .NET SDK is enough to build and run a program without either of them.

Where to Start

Install the .NET 10 SDK, run a single-file program with dotnet run, and then build a small console app such as a task tracker or a CSV parser before touching a framework. Move to the frameworks guide when you want a web service, and keep the SQL hub open for the database side.

Sources

  1. [1]
    A tour of the C# language
    (learn.microsoft.com)
  2. [2]
  3. [3]
    What's new in C# 14
    (learn.microsoft.com)
  4. [4]
  5. [5]
  6. [6]
    What is .NET MAUI?
    (learn.microsoft.com)
  7. [7]
    dotnet/runtime
    (github.com)
  8. [8]
    Creating scripts
    (docs.unity3d.com)
  9. [9]
  10. [10]
  11. [11]
  12. [12]
  13. [13]
    Stack Overflow Developer Survey 2023
    (survey.stackoverflow.co)
  14. [14]
  15. [15]
    JDK Project
    (openjdk.org)
  16. [16]