I have some background in Python and Bash (this is entirely self-taught and i think the easiest language from all). I know that C# is much different, propably this is why it is hard. I’ve been learning it for more than 4 months now, and the most impressive thing i can do with some luck is to write a console application that reads 2 values from the terminal, adds them together and prints out the result. Yes, seriously. The main problem is that there are not much usable resources to learn C#. For bash, there is Linux, a shit ton of distros, even BSD, MacOS and Solaris uses it. For python, there are games and qtile window manager. For C, there is dwm. I don’t know anything like these for C#, except Codingame, but that just goes straight to the deep waters and i have no idea what to do. Is my whole approach wrong? How am i supposed to learn C#? I’m seriously not the sharpest tool in the shed, but i have a pretty good understanding of hardware, networking, security, privacy. Programming is beyond me however, except for small basic scripts

  • sudo@programming.dev
    link
    fedilink
    arrow-up
    8
    ·
    edit-2
    19 hours ago

    People seem to be misunderstanding your question. It doesn’t sound like you are lacking educational resources to learn C# but a lack of reasons. It sounds like you have been learning by getting you’re hands dirty with foss software.

    C# is a sort of “enterprise-grade language” like Java. It’s meant for large applications developed by one or more teams for almost exclusively commercial purposes. If you want to learn it, deeply, you’ll have to come up with an excuse to write in it. A game is probably the best choice for this. Then learning c# is learning how to make your game.

    If you’re looking for open source C# software to hack on you can try anything from the *arr stack. (Sonarr, radarr, lidarr).

  • 31337@sh.itjust.works
    link
    fedilink
    arrow-up
    2
    ·
    20 hours ago

    I learned it because I had to write a WPF desktop application, so you could start with WPF tutorials. I was already very familiar with Java, which is very similar, so it wasn’t too hard. Last time I used it was in Unity. You might want to find a good free online course for C# to get a good grasp of C#/Java’s style of OOP, design patterns, and all that kind of stuff.

  • briggsyj@programming.dev
    link
    fedilink
    arrow-up
    3
    ·
    edit-2
    24 hours ago

    When I was learning c#, I found the .Net framework tutorials available on freecodecamp to be good.

    Also, using the Jetbrains Rider IDE (assuming this is for private non-commercial purposes, as per the terms of their free license) rather than VSCode or Visual Studio. VSCode is still lacking in features when it comes to c#, and Visual Studio probably makes more sense if you’re already accustomed to c# dev.

  • Michal@programming.dev
    link
    fedilink
    arrow-up
    36
    ·
    2 days ago

    You think Bash is the easiest language? I have to Google the syntax every time i need to write and IF statement!

    • alex@programming.dev
      link
      fedilink
      arrow-up
      3
      ·
      20 hours ago

      There’s a few languages I come back to after a while to fix something and have to consult their reference manual / docs. But bash is the only one where that’s necessary just to read back my own code. Like [[ -z ${ARG} ]]? Wtf is -z doing here. Wtf kind of syntax is that.

      Next time I think oh this could be automated with a little bash scrip I’m going to investigate one of those compiles-to-bash languages.

  • vrighter@discuss.tchncs.de
    link
    fedilink
    arrow-up
    34
    ·
    2 days ago

    one of the most popular languages, used in one of the most popular game engines, has no learning resources?

    Press X to doubt

  • eldain@feddit.nl
    link
    fedilink
    arrow-up
    4
    ·
    1 day ago

    Starting with Visual Studio (not code) helps a ton. Make a simple winforms application with a button and some labels and you will start to see how it ‘starts up’ from program.cs to your form.

  • masterspace@lemmy.ca
    link
    fedilink
    English
    arrow-up
    11
    ·
    edit-2
    2 days ago

    Don’t learn a language unless you need to use it for something.

    That’s why you’re finding it hard. If you needed to program a game, decided on Unity, and had a specific thing to do, it would be easy to figure out how to do that in C#.

  • 404@lemmy.zip
    link
    fedilink
    English
    arrow-up
    11
    ·
    edit-2
    2 days ago
    1. Start writing a small game in Godot using GDScript (basically Python)
    2. Use the Godot docs to read about C# alternatives to GDScript as you go, compare them and see how they differ
    3. Translate bit by bit of your game to C# using the docs
    4. Congrats, you have written a game in C#
  • Kogasa@programming.dev
    link
    fedilink
    arrow-up
    5
    ·
    2 days ago

    Start with the goal to create something, be it a console app, website, web api, or game. It’s hard to just study a language abstractly and learn it. Use the Microsoft Learn documentation as reference, and look for open source .NET projects on GitHub to get different perspectives on how to build things with .NET. There is a free course on freecodecamp that will get you started by building an app, and I believe it was done in partnership with Microsoft

  • Caveman@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    2 days ago
    1. Make a text adventure game that runs in the console.
    2. Tic tac toe in the console.

    Then if you want to go for a GUI web app with react use “dotnet new react” and create a to-do list with a client/server setup.

    If you want to learn to make games you could make a tic tac toe again but with a GUI in Godot.

    Once that’s done make tetris.

    You research what you need right before you need it and use it immediately so it sticks better. You’ll need to get comfy with typing systems and I recommend using an IDE like Rider or Visual Studio to program it since they help out a lot.

  • Thinker@lemmy.world
    link
    fedilink
    arrow-up
    12
    ·
    2 days ago

    Microsoft produces a plethora of good learning materials if you’re struggling with the basics or specific concepts. I recommend their C# for Beginners course to get a good overview of real C#.

    Once you have a good handle on the basics, I would echo others’ advice that having some kind of project or goal to work towards is the surest path to learning, because you have external motivation to use what you’re learning and look up things as you need them. Is there some reason you chose C# specifically as your next language, maybe for game dev, web dev, or Windows apps?

    • kekmacska@lemmy.zipOP
      link
      fedilink
      English
      arrow-up
      1
      arrow-down
      1
      ·
      2 days ago

      I did not choose C#, and after Python, i’d have chosen Javascript, Lua, or Java if it was my choice. I learn it in school, for some reason. My teacher is not very good at explaining things and basically leverages everything on us without teaching how to do it. And also, we learn c# once a week, which is propably not the intended way to learn a programming language anyway, and even then, most lessons are about flowcharts, number systems. Anyone who can learn c# in this enviroment is an absolute genius. Of course the whole class struggles with it

      • atzanteol@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        8
        ·
        2 days ago

        So… When you first start leaning to code you need to learn a lot of concepts, not just the language.

        Flowcharts help to teach about code flow, conditionals, loops, etc.

        You may be concentrating too much on language specifics. You’re not learning C# - you’re leaning to program using C#. There is a lot of theory behind programming languages.

      • lolcatnip@reddthat.com
        link
        fedilink
        English
        arrow-up
        2
        ·
        2 days ago

        Getting exposure to the language only once a week will definitely hinder you a lot. When learning a language, there’s a bunch of stuff you’ll memorize without even thinking about it if you spend time working on it every day, but it will be hard to remember if you spend a week between learning sessions.

        • kekmacska@lemmy.zipOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          2 days ago

          I have a lot more things to learn and it is understandable that i want to unwind a bit or learn something that i actually enjoy, rather than suck with c# with absolutely no motivation. Like i don’t know how i was supposed to learn multiple languages at once and understand both

          • atzanteol@sh.itjust.works
            link
            fedilink
            English
            arrow-up
            4
            ·
            1 day ago

            Like i don’t know how i was supposed to learn multiple languages at once and understand both

            Because the differences between languages isn’t often that big (in most cases).

            They have the same concepts with different syntax. Like with spoken languages - you know there are verbs, nouns, etc. but not what the other languages call a “library”.

            Nearly all computer languages have an entrypoint, conditionals (if … then), loops (for, while), datatypes (integers, floating points, strings), complex structures (class, objects, structs) and functions.

            You seem motivated to learn but struggling with your instructor. Copy/paste from course material in an annoying way to learn. What helps is to really “get in there”. To debug something. Only then will you truly hate programming 😁.

            Others have suggested a personal project and I’d recommend it too. Even simple things are fine - but try to modify them to do more and more. The more you’re iterating over the same codebase the more comfortable you’ll become with it.

            Harvard University makes CS50 (an intro to programming course) freely available and it’s excellent. It does use Python, which won’t help with the specifics of C#, but it would help with the other gaps in your knowledge.

            And remember - concepts translate between languages, so if you understand classes in Python then you just need to learn “how does C# do classes?”.

            • kekmacska@lemmy.zipOP
              link
              fedilink
              English
              arrow-up
              1
              ·
              1 day ago

              The languages i used up until now do not have entry points (intrepeted). I know what is that, but i don’t know where they should be. Up until now, i only used llms for debugging, i’m far from correcting source code, i’m happy if i can write something that even remotely resembles to the correct structure. Also, is it a good idea to start adding smaller functions to already existing c# projects made by others on github (not to publish, just for myself, don’t want to ruin someone’s work with malicious commits). My python understanding is vague too. Only class i ever defined was a csv file reading class like class Class: def init(self, stuff1, stuff2): self.stuff1 = str(stuff1) self.stuff2 = int(stuff2)

              • atzanteol@sh.itjust.works
                link
                fedilink
                English
                arrow-up
                3
                ·
                1 day ago

                Checkout CS50. It’s free and should help with the basics, even if it does use Python rather than C#. As I said before - the concepts are transferable. You need to learn more than just “syntax”.

                Programming can be hard at first. Don’t be discouraged if you find it confusing or if you need to start with very simple things. There is a lot to learn so keep your expectations low, and feel free to return and ask questions. And if you’re comfortable using AI you can use it to explain concepts and code rather than just having it spit out solutions. It’s usually pretty good for this since there is a lot of material on the internet for it to have learned from.

  • masterspace@lemmy.ca
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    2
    ·
    2 days ago

    Java and C# are very similar, worst case scenario learn Java, then C# will be easy.