How did you learn C#?

Maybe It's just that I'm impatient, but I'm not sure if just taking notes on Brackeys videos is the way to do it. I'm struggling on to work on a project I'm doing right now, but I refuse to parrot other people's code.

So are you good at coding in C#, if so how did you learn?

Don't just take notes...
Give yourself a project... For example code this to do that...
Than open the help files and start reading... type a code, see what happens... 3 days later - you are done...
Give yourself another small task... After this thing. it has to do that thing... then again...
Other than that, you can get a book or something...
But i like to learn by doing stuff...

1 Like

Yeah I have, last practice project I made was a calculator. It worked great... Except it only multiplied :(

I wouldn't pay me to write any C# code, but I have written a few programs for personal use - self taught. I use the personal project method as well. I think the best thing anyone can do is make lots of mistakes - then you learn how and why, rather than just how.

If I was doing it professionally, I'd follow it up with a certified course and/or dedicating a lot of my time to make sure my methods are industry standard. But I'd do that stuff later.

My two personal projects were a wheel diameter calculator (to help you choose new rims for cars without messing up your speedo) which is out on the internet somewhere, and a file transfer / bootstrapping package for getting files on to DOS PCs with a cheap USB adapter from your Windows 7 laptop - no floppies. The last one works but I haven't finished yet, but damn I learned a LOT doing that!

Historically, I've learned almost everything with this method. Pretty sweet in today's age of google, code completion, and forums.

1 Like

I learned in school but like psycho_666 said
is best to make and objective and chase it there are several sites that have lots of C# code

I my self if i don't find anything in C# i search it in VB , its almost the same but there is alot more VB code out there

I went to work at a company, completely not knowing C# or .NET, simply put I just learned it. Dropped into water not knowing how to swim kind of situation. But then again I'm being tutored by senior developers.

Give yourself some challenge, write something in the area you're interested in, be it web apps, back-end, rest api's, anything. But the trick is, set yourself some technical goals that will force you to dig deep into .NET: like high qps, as low as possible GC, unmanaged and managed memory working together, what lists and structures are good for what and such.

I have needed to work on an audio project with C#, then I found out how very undeterministic object lifetime is, even when you manually dispose them. This isn't even an issue on some high-load systems, it was just a resource that needed to be acquired by some other object almost immediately. I suggest you seek out these kind of quirks to learn as much as possible about .NET in general.

I had a project that I was already part-way through, written in I re-wrote and re-factored it in C#. However, it's still not done XD.
I had started watching the C# section of The New Boston but got bored of going through the generic steps. Having your own project is really the only way to go. Just be prepared to look things up A LOT.

As a tip if you're completely new to programming - if you think to yourself "surely there's an easier way to do this" there probably is. Case statements is one such example. til I die! :D

i like

Did it professionally for about 18 months something like 7 years ago. I new nothing about it specifically but I'd been a Java dev for 8 years by then and had previous VB background so it was nothing vastly different from what I'd done before. C#.NET... that was a bit mind bending :)

I just want to code my shitty little indie games, I'm not too interested in going full on in C# atleast not now. I guess I need to just keep plowing in

Just wanna drop in here and tell you that while it's good not to go straight to Google and copy some code, I do recommend you do Google problems that you come across and see what kind of solutions other, more experienced C# developers have come up with. Gives you another perspective on things, and maybe find useful parts of the framework that you were just not aware existed.

As for the question itself...I initially learned C# @ college, then got a job in a .NET shop where I've been working for the past 4 years.

1 Like

I learned some basic C# in college by making a calculator and hangman. It was only once I started working for a web development company and basically got thrown into the deep end that I really started learning more about the language. So I guess for me, I learnt by doing things and just messing around to see what would happen :)

I needed a small utility so I have found a program similar to that and next few months I kept breaking and fixing it until I got what I wanted. I did work in Pascal, VB, C++ and few other before that so I do not know if that counts. Anyway, I prefer it now to any other language. If you are learning C# start right away with XAML (universal app). WPF is very similar and uses xaml for UI but is only for desktop. Do not make anything with winforms, that is obsolete. Everything in Windows 10 is made with XAML: desktop, window management, start, even new office I believe. Visual Studio is still WPF.
As someone mentioned, do not just read bunch of books (I made that mistake with C++ and MFC) but start a project (I suggest a big one). Start from a code that is similar to what you want and make sense of present code.
You will get to the MVVM programming model, but that is complicated to the beginner and is not fun.
Or you can start C# with Unity but be aware that it might get weird once you try desktop development.

I learned at Centriq Training, a four month all day program for career switchers. Honestly would pay for my kids to do that and not college... but anyways after that most everything was projects at work. What I learned after four months was just the tip of the iceberg. I find it much easier to have a task defined by someone else like at work. I think I'd find it difficult to code anything very complex with just poking around the internet, I shudder to think what I used to write for people, but it worked, and many of the tools are free from MS now, so that's nice. I'm all web and console apps though.

Have you looked into Node.js or something more generic and JavaScript based? .Net is a great enterprise framework, and I guess they're doing some really neat things in the newer iterations, but I've never used it to code anything "cool" like a game.

Hi CapnFox
I thought I should chip in, so I finally made a profile on these forums to reply here.

Background info:
I am currently on an education which teaches computer science with a speciality in games. I am on my 4th semester now, and I have only learnt C# up until now, this semester we got a taste of C++. I'm from Denmark, so I do not really know what my education is called in English.

Now on to your question:
Our suggested teaching books were really boring and long winded, so I searched a little while and found a really concise book, which always goes right to the meat of things, teaching you about one new subject per chapter. And they are fairly short chapters.
The book is called "The C# Players Guide" by RB Whitaker.
And there is usually exercises at the end of each short chapter, so you can do your own tinkering.

I highly recommend this book, and you can get it from Amazon or directly from his website as a PDF. I picked up the PDF.

Starbound Software

Otherwise I would recommend tinkering with C# SDL2 bindings, or even Monogame, which is a small XNA like framework built on top of SDL2. There are a lot of tutorials and books on XNA and Monogame, and those two have an almost interchangeable API, except from creating spritefonts, last I checked. I learnt Monogame through class lectures and slides from my school.

Fez's Mac, Linux, Windows port is done with Monogame.
Bastion is also Mac, Linux, Windows with Monogame.
And there are more examples of successful released games on this framework.

I hope this was somewhat useful to you.

Best Regards