r/learncsharp • • Feb 29 '24

C#Learning Resources

60 Upvotes

Learning Resources

Here are some resources to learn C#. They vary in level -- most are for beginners, but not all.

Microsoft Course Modules and Documentation

Books

  • Rob Miles wrote the C# Programming Yellow Book, and the site includes links to courses and supporting materials

  • Gary Hall wrote Adaptive Code: Agile coding with design patterns and SOLID principles. This might not be the best book for a beginner, but it's great for someone who is interested in (or has experience with) object-oriented design principles.

  • Pro C# 10 with .NET 6 Troelsen and Japikse is a popular introductory book.

  • RB Whitaker's C# Player's Guide takes the unique approach of writing the book as if it was a player's guide for a video game. It starts from the beginning: installing Visual Studio and writing your first program, and moves along through different language features. Might be the best book for readers with no prior programming experience.

  • Albahari's C# in a Nutshell is typical of O'Reilly Nutshell books: it provides a brief introduction to many topis in the language, through it isn't necessarily a tutorial.

  • The Mark Price book C# 12 and .NET 8 – Modern Cross-Platform Development Fundamentals has an intimidating title, but is still a useful introduction to the language. It starts with the C# language, but also covers testing, entity-framework core (for communicating with databases), and writing web APIs and websites with ASP.NET. It might be a bit broad for a brand-new programmer, but does try to include new programmers in its target audience.

Videos


r/learncsharp • • 57m ago

C#'s rules for top-level statements turned out to be a great fit for a reactive notebook, so I built one

2 Upvotes

been working on something called Reverb, it's basically a notebook for C# where changing one cell automatically re-runs only the cells that depend on it.

the cool thing is that C# already handles a lot of the hard parts for us.

it's just a normal `.cs` file with `// %%` comments separating cells, and you run it with `dotnet run`.

one thing i found interesting is how top-level statements in C# make dependency ordering pretty straightforward. you can't declare the same variable twice, and you can't use a variable before declaring it. so the order of cells in the file is already a valid execution order. no need to build a separate dependency scheduler like reactive Python notebooks such as marimo have to.

there are still a few things that need to be checked though:

- a cell can't assign to a variable declared in another cell.

- anonymous types can't cross cell boundaries because the generated code needs to reference the type.

- local functions were an interesting one. turns out C# lets you call a local function before it's declared, which breaks the whole file-order-is-dependency-order assumption. had to add a rule for that too.

for dependency tracking, i'm using Roslyn's `SemanticModel.AnalyzeDataFlow` on each cell's statements. it tells us which variables are coming from other cells and which ones are declared by the current cell.

each cell then gets compiled into a static method. inputs are read from a shared value store and outputs are written back to it.

also added `#line` directives so compiler errors and stack traces actually point to the right lines in the original file.

here's a small example:

```csharp

// %% id=threshold

var threshold = Ui.Slider("Minimum order", min: 0, max: 1000, value: 400);

// %% id=summary

var big = orders.Where(o => o.Total >= threshold.Value).ToList();

big.Count.Dump("Orders above threshold");

```

move the slider and only the `summary` cell runs again.

install it:

```bash

dotnet tool install -g Reverb.Notebooks

```

it's open source (MIT):

https://github.com/muneeb-devp/reverb

would love to hear about any weird C# data flow edge cases i might have missed. especially things that could break the dependency tracking. always possible i've overlooked something :)

accidently created ama


r/learncsharp • • 4d ago

How do you learn C# in 2026?

20 Upvotes

Hi, as you've seen from the title I want to learn C# specifically in the Game Development and Desktop App department, the only problem is I don't know where to start from.

I've studied Python before as a kid so I'm pretty familiar with some programming theories and concepts, but I want to start creating (as in my opinion the best way to learn is by creating) but i can't really pinpoint a starting point.

I'd really appreciate if someone can help me!


r/learncsharp • • 11d ago

[Exchange] Native US English speaker for English practice, I can help with C# and backend development

11 Upvotes

Hi everyone!

I want to practice my English with a native US speaker. In exchange, I can help you with C# and backend development.

About me:

- Senior software developer with 8+ years of experience with .NET

- Native Spanish speaker, learning English

I can help you with:

- C# and .NET Core

- ASP.NET Core and RESTful APIs

- SQL and NoSQL databases

- Layered architecture

- JWT authentication

- Async programming and multithreading

- Microservices

What I am looking for:

- Someone who can chat with me about four or five times a week (text, voice, or video)

I am happy to help with basics about backend development. I can also help you with Spanish if you want.

If you are interested, please send me a message with a short intro about yourself and what you want to learn. Thank you!


r/learncsharp • • 21d ago

.NET 11 RC2 Adds Post-Quantum Crypto, .NET MAUI C# UI and NuGet Controls

Thumbnail visualstudiomagazine.com
5 Upvotes

d


r/learncsharp • • Oct 15 '26

Unity3D Jump Script Help

4 Upvotes

Hello! I'm working on a jump mechanic for a Unity game. I need to be sure the maximum value output of the line rb.AddForce(Vector3.up * (jumpForce * (float)forceOverTime), ForceMode.Impulse); is clamped at a specific maximum value, but I have not been able to figure out how...

The rest of the script is working fine. The section I’m stuck on is as follows:

void Jump_Performed(UnityEngine.InputSystem.InputAction.CallbackContext context)

{

if (isGrounded == true && context.duration < 1f)

{

rb.AddForce(Vector3.up * jumpForce, ForceMode.Impulse);

}

else

{

double forceOverTime = context.duration;

{

rb.AddForce(Vector3.up * (jumpForce * (float)forceOverTime), ForceMode.Impulse);

}

}

}

Thanks!

* Edited for grammar


r/learncsharp • • Oct 11 '26

How to solve that C# interview test

0 Upvotes

Sharing with you another C# mini-capsule where I present an interview-like snippet of code and resolve it. Hope you like it !

Any feedback is much appreciated <3
Thanks for reading.


r/learncsharp • • Sep 30 '26

~2min to learn something about C# and sharpen your code review skills

6 Upvotes

Out of idea on how to improve that C# mini-challenges / mini-courses series for now, if you have any feedback, it would be more than welcome. I'm trying to create small capsules that will teach something about C# in that code review / code interview style. This is my latest one. Thanks for reading.


r/learncsharp • • Sep 28 '26

How do you create a window you can draw shapes on?

10 Upvotes

I know how to make simple console apps like calculators. But if i want to create a simple game like Pong how do create a window where i can draw stuff like squares


r/learncsharp • • Sep 28 '26

Explore new features available in C# 15 preview

Thumbnail
devblogs.microsoft.com
7 Upvotes

r/learncsharp • • Sep 27 '26

Visual Studio 2026 C# complete tutorial

9 Upvotes

r/learncsharp • • Sep 26 '26

Covariance and contravariance massive confusion

3 Upvotes

Whattup y'all,

I've been learning C# through Codecademy (intermediate course) and W3 Schools, and practicing in the workspaces. I've just gotten through the lesson on generics, which ended with covariant and contravariant interfaces and I just am not understanding it.

I think the biggest thing I'm having trouble with is the purpose. Maybe I'm getting it, but it just doesn't feel like it. So, please correct me if I'm wrong, but let's say I'm working on an RPG and I have:

public class Weapon : Equipment
{
public string Name { get; set; }
public int Damage { get; set; }
}
And then something like

public class Armor : Equipment
{
public string Name { get; set; }
public int Defense { get; set; }
}

Then I would want to have a covariant interface, for example, like:

public interface IItemProvider<out T> where T : Equipment
{
T EquipItem();
}

Which would allow me to make a class like

public class UseEquipment : IItemProvider<Weapon>, IItemProvider<Armor>

{
Weapon IItemProvider<Weapon>.EquipItem()
{
return new Weapon { Name = "Great Sword", Damage = 15 };
}
Armor IItemProvider<Armor>.EquipItem()
{
return new Armor { Name = "Iron Armor", Defense = 10 };
}

}

So that way even though weapons and armor are different types of equipment, they can still use the same EquipItem() functionality because it uses a generic type and allows the more derived types of Weapon and Armor to be substituted for the base class Equipment. That is how I'm understanding it. And I still feel like I'm confused, but I am just really not sure at this point. I appreciate any feedback.


r/learncsharp • • Sep 19 '26

Finish C# player guide and took a 3 month pause

21 Upvotes

So i finish the C# player guide took a pause and now i feel like i know less then i back then

When i finish it i still did not know how to work with classes, afraid that some will be to reliant on each other and make "tight coupling", some like generics, structs, records did not know how to work it. I already forgot a lot of thinks about the part 3 in the book.

Object oriented design was confusing for me and could not understand on how or why to create some classes to work with other classes.

Should i try other books or courses to try to solid my understanding?

Yes i know about making projects but what projects can I do with my jumble of information that i have in head?


r/learncsharp • • Sep 17 '26

C# courses that keep you learning in ~2min bites

20 Upvotes

I'm experimenting with this series of C# mini-challenge / mini-courses, trying to create bite-sized capsules that will teach you something about C#. Sometimes serious, sometimes edgy, or even using funny contexts. There is a full playlist of it as I publish a new one every week. Would love to get your feedbacks on the latest one : https://youtu.be/J27gidcV8OA

Thanks for reading :)


r/learncsharp • • Sep 16 '26

6th Form Secondary School Student Needs Your Help

Thumbnail reddit.com
1 Upvotes

r/learncsharp • • Sep 15 '26

Is Codeacademy a good resource to learn C#?

8 Upvotes

Sorry if this isn’t allowed.

I’m wanting to learn basic C# to make mods for the Sims 3. I’ve started on Code Academy and have learned basic coding on there. I’m just wondering if it’s actually a good resource. Thanks!


r/learncsharp • • Sep 16 '26

SEC EDGAR API but in C#?

Thumbnail
reddit.com
0 Upvotes

r/learncsharp • • Sep 03 '26

I'm scared that learning C# will mess up school stuff/ is C# easier with a java background.

Thumbnail reddit.com
5 Upvotes

r/learncsharp • • Aug 24 '26

My first big project, I need feedback !

Thumbnail
reddit.com
0 Upvotes

r/learncsharp • • Aug 19 '26

MongoDB + Docker + .NET: A Simple Local Development Setup

16 Upvotes

If you're working with MongoDB and .NET, Docker can make the local development setup much simpler.

Instead of installing and configuring MongoDB directly on your machine, you can run it in a Docker container and connect your .NET application to it.

I put together a practical guide covering:

  • Creating a MongoDB Docker container

  • Configuring MongoDB

  • Connecting a .NET Core application

  • Understanding the container-to-application connection

  • Setting up a consistent local development environment

📖 https://geeksarray.com/blog/create-mongodb-docker-image-and-connect-from-dot-net-core-app

For those using MongoDB locally, what's your preferred setup—Docker, local installation, or something else?


r/learncsharp • • Aug 19 '26

A new bite-sized C# challenge

2 Upvotes

Looks like few of you add fun with my latest C# debug challenge post. So here is a new ~2min code review challenge if you feel for another shot :)


r/learncsharp • • Aug 17 '26

What happens to the task when a synchronous method returns?

4 Upvotes

I have a synchronous method which calls an async method (obviously without awaiting) and then returns. What happens to the task after that? Will it finish executing? Do I have to use something like 'RunSynchronously'?


r/learncsharp • • Aug 12 '26

Sharpen your Debug and Code Review skills with theses 2min challenges

5 Upvotes

Lately, I've felt the desire to share more of what I've learned. And I must say, teaching is a skill that's much harder to develop than I expected...

While experimenting with ways to make learning funnier, I came up with that series idea. Funny challenges with code setup as a story, delivering jokes or even edgy context 😅

Challenge yourself and keep sharp, at any level.

https://youtu.be/3lJcE1lMHNI

May you have any feedbacks, I'ld love to ear them :)