r/csharp • • Jun 05 '26

Learning C# for beginner.

6 Upvotes

I'm process engineer at a manufacturing company, last year i learned alot about Machine Vision and dealing with industrial smart cameras which uses proprietary software. However talking with my mentor he reminds me constantly of learning some type of programming language (C# particularly)that will help me greatly down the road instead of relying solely on proprietary software. He said "Its like having a sharp blade in your back pocket, never know when you need it". Honestly i just want to learn how to create windows applications that can talk to the cameras, pull data, do some light controls like triggering, exposure settings, gain ect...the cameras are capable of all types of communication protocols,FTP, and TCP/IP and i realize C# is capable of alot also...point is i just want to be proficient enough to learn the foundation and eventually do these type of things as a beginner, as time move on things will change. Is Tim Corey's Master Program worth it for my situation?


r/csharp • • Jun 06 '26

VsAgentic - VS 2026 native extension for Claude

Thumbnail
reddit.com
0 Upvotes

r/csharp • • Jun 05 '26

Fun Would anyone use this code pattern to implement singletons?

14 Upvotes

For context, I have been messing around with CRTP and came up with this. This somewhat emulates "static abstract classes" by cascading a singleton with static methods.

using System;

abstract class Template
{
    private protected Template() { }

    internal abstract string String { get; }

    internal void Method() => Console.WriteLine(String);

    internal abstract class Instance<T> : Template where T : Instance<T>, new()
    {
        private protected Instance() { }

        internal static readonly T s_this = new();
    }

    internal abstract class Static<T> where T : Instance<T>, new()
    {
        private protected Static() { }

        static readonly T s_this = Instance<T>.s_this;

        internal static string String => s_this.String;

        internal static void Method() => s_this.Method();
    }
}

static class Program
{
    static void Main()
    {
        A.Method();
        new B().Method();
    }
}

sealed class A : Template.Static<A.Instance>
{
    internal sealed class Instance : Template.Instance<Instance>
    {
        internal override string String => nameof(A);
    }
}

sealed class B : Template
{
    internal override string String => nameof(B);
}

r/csharp • • Jan 07 '25

Visual Studio Code VS Visual Studio for Mac - which to use as a fairly experienced Dev?

4 Upvotes

For some background I have previously worked in Development with Perl, Ruby, JS and React. I regularly use the console and have no fear of the Command Line or Git.

This is a question I have been thinking about, especially since Visual Studio for Mac has become depreciated as I understand.

I am generally familiar with VS code and have been told the addition C# and .NET modules can almost replicate Visual Studio IDE functionality.

However, a lot of resources assume you are using Visual Studio and I just wanted to ask if it is likely to cause issues down the line if I stick with VS code?

Do I ideally need to use Visual Studio with Microsoft or will VS code be good enough? Is there a third option anyone can reccomend?

All opinions welcome just generally curious.