C# developers typically work in a business setting, creating apps that interact with databases and provide a front end. The user interface (UI) will either be a web front-end or a desktop app that runs on Windows as a standalone app. Here we’ll talk about C# for desktop apps. How do you become a C# developer?
Master the Language Itself
The first step is to master the language itself, either through self-study or by taking a course. Start by studying the official documentation here, particular the Getting Started section, the Fundamentals section, and the Key Concepts section. Don’t just read them! Install the tools we discuss below, and practice as much as you can. Here are some important topics you’ll want to learn:
- Classes, how to create instances of classes, and how to create useful constructors.
- How to use properties in classes and why they’re different from “regular” members.
- How to use static members.
- How to use inheritance and how and why to use interfaces.
- How to use the wizards and keyboard shortcuts in Visual Studio to help you create your classes and members.
- How to use LINQ (pronounced “link”).
LINQ Is essentially a language-within-a-language and it’s used for querying data that can live either inside your variables or inside a separate database.
Next, familiarize yourself with the .NET framework, which is a massive library filled with classes to help you program. Don’t go crazy trying to learn and memorize every aspect of it; it’s too huge to try to squeeze into a human brain. Instead, get to know in a general way which classes are available so that you can use them when needed, rather than trying to write your own code that does the same thing.
For example, there’s a class called Queue. When you need to create a queue structure, you can use Queue instead of wasting precious developer time coding your own.
Stay on top of current best practices. For example, if you are making an API call, use the most recent framework features for calling an API. Previous frameworks had a different set of classes for calling APIs. The newer classes are optimized and have improved functionality.
But that said, it doesn’t hurt to be aware of the older classes in case you end up on a project with legacy code.
Learn Asynchronous Programming
Asynchronous programming allows your code to flow smoothly while continuing to work behind the scenes. Learn about asynchronous programming in C# and how it impacts your chain of method calls. Learn how to use the Task model of asynchronous programming. Also, take time to learn what’s actually happening behind the scenes regarding order of execution; that will help you understand why Task is important and how to use it effectively.
Learn Entity Framework
Entity Framework (often abbreviated EF) is a set of classes and tools that make database programming easier and less bug-prone. You can create databases and tables; you can add data to the tables; you can query data; you can modify data, each with just a couple lines of code.
On one hand, EF is ideal because you don’t need to learn SQL (Structured Query Language), which is the language used by database servers. However, please don’t skip SQL. You’ll still use it occasionally, such as when you need to test your data. Even positions that don’t explicitly mention SQL in their job ads will likely want you to know SQL… and they may ask you about it in an interview. Here are the basics of what you should learn:
- How to create databases and tables with SQL.
- How to insert data into a table.
- How to read data using select statements, where clauses, and joins. Learn all the types of joins!
- How to delete data.
For desktop applications, you have some choices for the user interface. Microsoft has created several systems over the years, and some have held the test of time while others have not. At present, there are at least three different ways you can build front ends on a Windows desktop:
- Windows Presentation Foundation (WPF)
WinForms is the oldest and arguably the easiest way to create UIs. You simply drag and drop buttons and other elements onto a window, and that will become your user interface. However, WinForms is also very limited in functionality. Our recommendation is that you spend a couple hours playing with it, just so you’re familiar with how it works, just in case you end up having to work with some legacy apps.
WPF came next, and is still the most important desktop library to learn. It’s powerful, but a bit more difficult to use than WinForms. Truth be told, it’s a little confusing to use and has a bit of a learning curve. Plan to spend a lot of time learning it.
WinUI is the newer of the bunch, but still over a decade old. And it’s also the trickiest to offer advice on. WinUI was supposed to be a total revamp of how to build UIs in Windows, and it was to also provide support for Windows Phone, which doesn’t exist anymore. From what we’ve seen out in the field, WinUI is being used by teams, but not nearly as much as WPF. Our advice is to first learn and master WPF, and then, as with WinForms, spend some time practicing with it so you’re familiar with it.
In order to program with C#, you’ll need to install some tools. The first tool you’ll want to install and learn is Visual Studio, specifically the Community Edition. This is the Cadillac of software development. It’s big, and there are a lot of parts you won’t need to learn. But it’s the standard tool.
Separately, a lot of teams have moved to a different product also made by Microsoft called Visual Studio Code, usually abbreviated as VS Code. Yes, the name is similar, but it’s a completely separate tool from Visual Studio (don’t call VS Code “Visual Studio” or people will think you’re talking about the other one).
Next, install SQL Server Developer Version. This is a fully-functional version of SQL Server very similar to the premium versions. (Choose Developer over the free “Express” version, as the developer version has far more features.) Then, install SQL Server Management Studio.
And finally, learn both Git and GitHub for version control. Visual Studio and VS Code both have Git integration such that you can use Git by only clicking buttons. However, please take time to learn to use the command-line program called git. This is vital, as there are times you’ll be logging into remote systems and only have access to a command-line tool. (Also, many developers much prefer the command-line version of git.)
A common question among new developers is, “Where do I gain experience?” The biggest advice here is to search GitHub for open source projects looking for C# developers. That’s where you’ll likely find senior C# developers who can assist and mentor you as you master the language.
C# is a fun language to work in. The tools are quite powerful, helping assist you along in your coding. C# has evolved from an early language that resembled Java, and it continues to iterate into a more useful form, so make sure you stay on top of the latest advances. Whenever there’s a new version, download it, and learn about the updates. Given its continuing popularity and the sheer amount of legacy code out there, C# is likely to be around for a very long time.