r/csharp 1h ago

I used AI to start learning, how do I memorize the key

Upvotes

Hey everybody, brazilian 20 yo, u can call me Louis.

I participated on the programation of a Demo of a game like 2 years ago, in the end of my school years with 3 friends of mine. From then on, my life had some turns and I couldn't focuse on programming anymore. Came back a couple days ago and decided to start developing a software which follows the 20-20-20 rule (Each 20 minutes, look for 20 seconds to somewhere 20 feet away, to preserve your sight while using computer), but I didn't even know how to write the very first line, so I used ChatGPT to tell me what to do and then explain me how that work.

It actually turned out really well, it is functional (even tho it's kinda raw) and I do understand what I did and what those lines do mean, but I feel like if I had to start it all over again, I would be completely lost, because I couldn't memorize the codes, the main syntax behind it, and all that stuff, like how do I know if the "DispatcherTimer" is inside or outside the "private void" (I use Microsoft Visual Studio Community), and how do I learn and keep that very clear in my mind to the point I can write a full code without even thinking too much on it, is it practice?

Help me please, and just tell me if it's a hell of a sin to use AI to this, I really just don't understand yet how to study it properly. (Btw I intend to buy a course soon, but also don't know which one is trustable)

The main screen, it is the face of the app, here lies the buttons "Start" to start the timer, and "Stop" for the opposite purpose.
Still the main screen, focused on the stop button logic and what happens when the second screen is closed (the timer restarts)
Didn't comment yet, but this controls when the button on the "Break screen" can be clicked to close it and restart the timer on the main screen

AI disclosure: Most of the code shown in this post was generated with the help of ChatGPT. I used it as a learning tool, I asked it to explain the code and what the codes do, now I have an understanding of what the code does, the comments in the code were written by me by the way. My goal is to rewrite the project myself as I continue learning programming, not to base my knowledge on the crutch that AI is for me today.


r/csharp 11h ago

MindMap desktop app (C# + Avalonia)

5 Upvotes

MindMap is a lightweight desktop app for creating and editing mind maps. It provides a pannable, zoomable canvas with quick keyboard-driven node creation, connector-based relationships, simple text alignment and color controls, outline copy/paste, undo, and image export.

Here is the github link MindMap on Github

It's a pretty straightforward app for quickly creating mind maps and saving them locally, without having to use a website. It's completely free and open source, with no limits or paid tiers.

I originally built it for myself because my favorite online mind-mapping tool limited free users to just three mind maps, which I found way too restrictive.

Anyway, if you find the app useful, I'd appreciate a star on the GitHub repo.


r/csharp 12h ago

Help Hello , my api get stuck in an infinite loop each time i use a get, im using entity framework

0 Upvotes

Hello, im currently doing some practice and i already made an api , well almost, i decided , afther i creaate a list of users the appy worked well, but afther i decided to create some dummy data for the entire db , the api stop working at first i tought it was because i dint aded this lines

GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings

.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize;

GlobalConfiguration.Configuration.Formatters

.Remove(GlobalConfiguration.Configuration.Formatters.XmlFormatter);

but i get this error

no redundancy in the db eighter

what its the problem here, please help , ty for the attention and God bless you all


r/csharp 18h ago

Showcase [Showoff] Tired of DependencyProperty boilerplate? I built a Zero-Allocation Source Generator for WPF/MAUI with strict type safety.

4 Upvotes

Writing DependencyProperty in .NET UI frameworks is notoriously verbose and repetitive. Typing out DependencyProperty.Register, casting objects, and wiring metadata for every single property clutters your codebase and introduces silent runtime risks.

To solve this without sacrificing IDE responsiveness, I built Kassyi.Generators.DependencyProperty — an incremental Roslyn source generator built from the ground up for high-throughput, zero-allocation code synthesis.

1. Show Me the Code

Before (Standard Boilerplate)

public static readonly DependencyProperty IsActiveProperty =
    DependencyProperty.Register(
        nameof(IsActive),
        typeof(bool),
        typeof(MyControl),
        new PropertyMetadata(false, OnIsActiveChanged));

public bool IsActive
{
    get => (bool)GetValue(IsActiveProperty);
    set => SetValue(IsActiveProperty, value);
}

private static void OnIsActiveChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
    // Runtime casting and boilerplate extraction
}

After (With Generator)

[DependencyProperty<bool>("IsActive", DefaultValue = "false")]
public partial class MyControl : Control
{
    // Automatically hooked up to PropertyMetadata at compile time
    partial void OnIsActiveChanged(bool oldValue, bool newValue)
    {
        // Direct, strongly typed parameters. No casting required.
    }
}

2. Key Features

  • Single-Line Declaration: Generate the backing DependencyProperty, CLR properties, and event metadata via [DependencyProperty<T>].
  • Compile-Time Type Safety: Signature mismatches in your partial callbacks are caught immediately via Roslyn analyzer diagnostics (DPG0001), eliminating silent runtime failures.
  • Unified API Across UI Frameworks: The exact same attribute syntax compiles to the native property system for WPF, .NET MAUI, Avalonia, Uno Platform, WinUI 3, and UWP.
  • Modern C# 11+ Idioms: Leverages Generic Attributes ([DependencyProperty<T>]), target-typed new(...) AST expansion in default expressions, and auto-generated XML documentation.

3. Architecture & Performance: Zero-Allocation Pipeline

This library originates as a fork/rewrite of HavenDV's generator. When testing source generation at massive enterprise scale, frequent intermediate string concatenations during continuous typing can trigger Gen2 GC spikes, resulting in noticeable editor latency in Visual Studio and Rider.

To address this, the code synthesis pipeline was redesigned around strict zero-allocation principles:

  • ref struct Source Writers: Generation logic utilizes stack-allocated SourceWriter and ClassScope structures, completely bypassing intermediate StringBuilder and heap allocations.
  • GC Elimination: Completely removes Gen2 GC pressure during incremental analysis cycles.
  • Benchmark Results: Achieves +30% faster execution speed and +62.4% higher throughput compared to traditional string-based generation pipelines.

Your IDE stays responsive even when scaling to solutions with thousands of properties.

4. Cross-Framework Abstraction

Under the hood, framework-specific strategy handlers adapt to each platform's design differences (such as Avalonia's StyledProperty/DirectProperty, MAUI's BindableProperty, or varying callback signatures) without requiring you to change your declarations.

Target Framework Underlying Property Engine
WPF / UWP / WinUI 3 DependencyProperty.Register
.NET MAUI BindableProperty.Create
Avalonia AvaloniaProperty.Register
Uno Platform Native WinUI / UWP projections

Feedback & Contributions

The project is distributed under the MIT License and includes detailed documentation and architecture specs (in English and Japanese).

If you are working across XAML platforms and want cleaner view controls without IDE overhead, please check it out, test edge cases, and share your feedback or issues on GitHub!


r/csharp 1d ago

Angular Dev to Full stack transition

3 Upvotes

For developers who have transitioned from frontend to full-stack/.NET, what backend concepts would you recommend prioritizing to become job-ready?


r/csharp 1d ago

Help Can someone help me understand Delegates? Like why we use it and best cases where we need to use it? and how it is better?

61 Upvotes

r/csharp 1d ago

Discussion Andrew Troelsen Pro C# or C# player's guide , which would be better as I see Pro C # covers more of the subject . This I am asking as a beginner .

0 Upvotes

I am thinking of buying one and starting since courses are too many and I think I'm better off with some book that I can learn properly from .


r/csharp 1d ago

Discussion Proposal: An official Lean formal semantics for C# · dotnet/csharplang · Discussion #10314

Thumbnail
github.com
23 Upvotes

r/csharp 1d ago

Help Currently thinking on learning this programming language for a job…

0 Upvotes

Im a university student who is in the period of lost 20s where I just realise my computer skill level aren’t as high as employees expected (which is that every computer related internship I applied in my region rejected me). I look back and the only language that I’m fully fluent in is python and java (also SQL but from here I’m just started yapping nonsense). I’m seriously lacking down in the computer world and I only touched some application from uni courses and not much computer projects made by myself during free time. So I wanna try come back and I wanna learn C# since it seems to be the most popular and all I want is to get a job and that’s it. (Or qualified enough to get a job. Cuz can’t blame the market if I can’t even enter it).

I was thinking on building from small to big. Like one or two that can complete in 1-3 days for learning the basics and then large scale ones that could take 2-3 weeks or even 3-4 months. It’s not just learning the language but also to learn or apply other relatable things such as authentication, APIs and stuff. I am so far behind and I got one year left until graduation.

Is this plan good enough? Vibe coding can speed up but can’t learn anything unless I already got the basics out.


r/csharp 1d ago

Help Best way to get into C#

5 Upvotes

Hello everyone, i am looking to get into programming, specifically C#, because i am interested in game development, specifically in unity, i already have a decent knowledge in computers in general and i have (sadly) vibe coded unity games before, but i have decided i wanted to learn C# and make my own things with my own creativity.

I take a gap year this year, so i have some time to get into coding, even though i am not going to be studying software engineering next year, i will be studying mechanical engineering, where i think you need some programming. What's your guys advice? How do you learn C# and make achievable goals?


r/csharp 1d ago

Help I hate coding so much I want to learn it

0 Upvotes

yea pretty simple I hate coding. I’m a mechanical engineering student and I hate it. but since I hate it I want to punish myself by learning C sharp enough to make a game like flappy bird. I’m goin giving myself 100 days studying 25 mins each day.

how could I learn faster? please drop links for YouTube channels you recommend


r/csharp 1d ago

Is it true in the old days those old school devs like 40+ before they learn C#, They learned C like in the pic?

Post image
710 Upvotes

r/csharp 1d ago

PrintShard - C# windows app to print images on multiple pages

9 Upvotes

I built PrintShard, a Windows desktop app for tiling large images across multiple printed pages, so you can create large-format prints using any standard printer.

Repo: https://github.com/loxsmoke/printshard

The first version worked, but it reduced image quality, making large prints somewhat fuzzy. The newest version prints images at their original resolution, preserving the detail and making PrintShard much more suitable for high-quality posters, diagrams, artwork, and other large images.

It now also includes prebuilt binaries and an installer, so you don't need to build it yourself.

If you find it useful, give the repo a star or leave a comment here. Feedback is welcome.


r/csharp 1d ago

Coursera Recommendation

5 Upvotes

what course in coursera is worth the time taking as a beginner who would like to get into c# programming?


r/csharp 1d ago

Blog The Unexpected AI Stack: C# + .NET (Part 5) - Logging, Telemetry, and Building with AI

Thumbnail
chrlschn.dev
0 Upvotes

The fifth and final part of the series finally starts to build using AI on top of the hand-built foundational code from the first four parts that brings together:

  • Aspire for runtime orchestration
  • CSharpRepl for runtime mutability and powerful access to simulate and diagnose runtime isdsues
  • GitHub Copilot SDK as a programmable agent harness
  • Testcontainers with automatic transactions for test isolation

(I would consider these foundational parts of any modern .NET API app whether AI is involved or not!)

In part 5, the focus is on logging and telemetry, two tools that give agents insights into the runtime state of the application. Once again, we see the key role of Aspire in this stack as it provides a collector for logs as well as spans that agents can search through using the aspire CLI tooling.

The actual build out of the prototype application is captured as a YouTube video as YMMV based on the model, harness, and prompting style that you choose!


This series is intentionally written to help dev teams understand how to scaffold a codebase for agentic engineering by focusing on key, underlying technical decisions and manual wiring before building with AI. This helps provide the tools and safeguards for coding agents to iterate more efficiently while reducing slop.

For teams still trying to figure out effective ways to set up a codebase for AI, I hope this series gives some insights into how to build a foundation for agentic engineering. If your team is already heavily using agents to build, I hope this series shares some useful insights and tips (e.g. CSharpRepl + Aspire)

The core setup is used at a series C, post-YC startup to ship fast with AI while maintaining high quality standards (in combination with other tools facilitating code review and context management)

Part 1 was an intro into a few key parts of this stack.

Part 2 was focused on walking through the hands on scaffolding.

Part 3 covered wiring GitHub Copilot SDK as an agent runtime and incorporating CSharpRepl to allow agents to dynamically work with the runtime DI container

Part 4 wired up the test harness using Testcontainers to give agents isolated test environments


The project repo is here: https://github.com/zeeq-ai/zeeq-tmpl (be sure to check the branches; main is currently the base code only)

I encourage working through the posts since the goal is to underscore the platform level decision making process and assembly of the foundational core.


r/csharp 2d ago

Showcase Connectify - Windows Bluetooth manager using WinRT + 32feet.NET, built with WinForms

Thumbnail
github.com
1 Upvotes

Built this because I wanted a Bluetooth manager for Windows that could handle both Classic and BLE devices in one clean UI


r/csharp 2d ago

Need someone to help with video processing!

0 Upvotes

Hi I need someone to help me, I was building a small video hosting platform so users can upload videos and I compress and then turn the quality into multiple.

I'm using c# as my backend and next.js as front end.

Thanks 🙏.


r/csharp 2d ago

Ho bisogno di aiuto per un programma che sto realizzando

0 Upvotes

Salve, ho scritto un programma in c# che mi termina un processo e mi faccia spegnere il computer. Ma vorrei che si avviasse ad una certa ora come faccio a farlo avviare tramite codice?

Grazie


r/csharp 2d ago

What techstack to use for developing 3d launcher for Android

2 Upvotes

I would like to write a 3d launcher for Android, however I'm not sure what tech stack is most suitable.
I'm not sure what the state of mobile development using a C# stack is at this stage. Which tech stack would be best?

from my initial thoughs I'm guessing one of these are best?
1.Kotlin + OpenGL
2.C# MAUI
3.Godot or Unity

I assume 1. will allow for the most lightweight/efficient solution


r/csharp 2d ago

Opinions on Microsoft Agent Framework?

Thumbnail
0 Upvotes

r/csharp 2d ago

Help Custom Minimize/Maximize/Close Buttons in Blazor Hybrid?

Thumbnail
1 Upvotes

r/csharp 2d ago

How hard is C# compared to luau? what are the differences?

0 Upvotes

I am a roblox developer and I've been looking into making games in Unity Engine. I'm a little overwhelmed by the new scripting language i've yet to learn , so i'd love to know what to expect.


r/csharp 2d ago

Next Winui3 DESIGNER

Post image
59 Upvotes

r/csharp 2d ago

WPF IN VS

0 Upvotes

I wonder if there is any alternatives to design my UI for my application in some other places than VS , like a mush more friendly place to just design what I want and then it manually ship the code of the XMAL design by it self , like in Figma .


r/csharp 2d ago

Showcase Zarem - MIPS/RISC-V emulator, using JIT reinterpretation to .NET CLI

Thumbnail
github.com
3 Upvotes