Introduction
It’s time to start coding! Welcome to fantastic world of C#! If you haven’t yet, checkout the C# Setup article. You’ll need to set up your C# developer environment before starting.
Now it’s time to learn basic C# syntax. You need to be familiar with a few concepts and techniques before jumping into your first real project. How you approach this initial contact with the language will depend on your learning style, but here’s our advice: Don’t try to understand everything before starting to build.
You don't need a lot to start building
One of the biggest mistakes people make when starting to code is assuming they need to know a lot before building interesting things. You’ll be surprised by what you can create with basic concepts you can learn within a few hours.
By all means, make lots of notes when you’re first learning to code. Go through the entire material once or twice. But that’s it! The basic syntax hasn’t changed significantly over the years, and it won’t in the future. You’ll have to revisit the basics many times during your journey. Everything you initially encounter will only be internalized with practice. So make sure you don’t spend more than a few hours learning the basic theory.
Here’s an example of your self-talk when you start your first project: 'Oh, what do I need to do here? I think an if-else statement will be good to get the user input. How do I write it again? I remember I saw it in the documentation, but I’m not quite sure'. Then you’ll go back to your notes or the documentation, get what you need and apply in your code. You won’t know exactly how to do it, or even how it works yet, but you’ll know where to look and learn how it’s applied once you use it.
Learning With Microsoft and Free Code Camp
In 2023, Microsoft partnered with Freecodecamp to create a C# certification. It's an excellent course, perfect for absolute beginners to get started. Experienced C# learners will also benefit from this certification, as we all have knowledge gaps, no matter how long we have been learning.
If you're just getting started, we highly recommend that you don't rush past the sections of the certification. Read every line carefully and make notes. An effective way to write notes is to focus the concepts that are new to you or anything that stands out. Avoid writing down things you already know, as it's unlikely you'll ever refer to those notes again if they aren't genuinely interesting.
After submitting your certificate to the Academy, you'll be rewarded with 20 Experience Points. The certification is a requirement to achieve Green Belt.
Math Game
After the certification, you can optionally take our Object Oriented Programming Crash Course, if you still lack the confidence to start your first project. If not you can always take it later in your journey. The next step in the roadmap is the Math Game. You might even start the project in parallel with the certification, if you find it boring. We've had feedback from a few students in that regard. People have different learning styles and going through the sections might be difficult for some. If that's the case, start the project right away!
In this project you'll be using and reinforcing the basic concepts, techniques and syntax learned so far, laying a solid foundation before we can move on to more complex software. We suggest you try to complete all projects without help initially. With the Math Game it might be difficult if you don't have previous experience with C# or programming in general. In the project page, you'll find a video tutorial to get you unstuck in case you need it.
In the first part of the tutorial, we will build a console app where we’ll go over all the basics you need to get started. Starting with a console app is important because you can focus purely on C#. If you jump straight into Web, Desktop or Mobile Apps, there’s a lot of overhead code and setup that will distract you from actually learning what’s necessary at this stage.
But we understand that console apps aren’t necessarily very exciting. It’s nice to create something beautiful early on. So in the second part, we will build the same app using the .NET Maui, a modern cross-platform solution that enables us to build apps for Windows, Apple, Android and Mac using one single code base.
In the second part of the tutorial, you’ll again build a math game, but this time building a Desktop app, with the amazing .NET Maui. You can use the knowledge gained from this project to build an interface for all of your projects from now on. It can serve as a sandbox for you to practice your C# skills as opposed to the console.
Creating Your Library
In the C# Setup article , you learned you have to create your source control repository. This will be your ultimate reference book. Every piece of code you ever write should be saved there. And guess what? That will also become your toolbox. You’ll constantly grab pieces of code you’ve written before to reuse in your projects.
You can also use your note taking system for that. If you keep your notes and repository organised, you’ll feel like you’re building a nice library of code and saving time not having to rewrite everything from scratch. That will allow you to look for the next, more complex challenge, which will in turn become part of your library. Imagine where you’ll get after a few years doing this.
More Videos
It’s great to learn from different sources. While we’re biased towards C# Academy’s beginner’s tutorial above, since it’s unique in that you learn concepts by applying them, we recommend you try different instructors throughout your journey. Here’s my favourite Beginners tutorial. Mosh touches on everything you need to get started. Tim Corey is another excellent instructor to get started with.
The most watched C# course on Youtube is excellent but it’s four hours long. It might take you weeks to watch it. We suggest you don’t go through the whole thing before jumping into projects. That’s exactly the type of behaviour that makes people quit. Initially stay away from super long, comprehensive tutorials, unless you break them in pieces and mix theory with practice.
Also, use other sources such as Youtube, ChatGPT and other learning platforms to fill knowledge gaps. If there’s something you don’t get during your journey, search for that specific topic, and you’ll find tutorials tailored to it. The various teaching styles and approaches will help you understand the particular area you’re struggling with.