Even though it’s been around for 20 years, there’s never been a better time to learn C#, since it is considered a truly modernized programming language. Whether you’re looking to get into web development, mobile app development, desktop applications or game development, or you just want to start learning programming, C# is a great general-purpose language to master because of its versatility. I started my career with several other languages, and even though C# wasn’t my first, it’s a strong language and ecosystem that offers flexibility and power to any kind of project.
Originally, I started learning C# to open up more programming opportunities. The company I currently work for handles a lot of large web service projects written in C#/.NET. While I generally work on the front end, I decided to start learning C# to better understand the back-end services our team writes. Additionally, I’ve always been interested in video game development, and with a growing number of modern game engines being developed in C#, learning the language seemed like a worthwhile endeavor.
Since C# was not my first programming language, I already had a solid understanding of the fundamentals to work with when I started learning it. According to Jiří Činčura, a developer and author of the blog Tabs Over Spaces, those principles are the most important place to start.
“I would first focus on the basics,” Činčura says. “I know it’s sometimes boring, but I think in three days you could get the basics down and have a solid understanding and starting point.”
If you’re like me and already have that solid understanding of programming fundamentals, you can jump in to learning C# quickly. The main syntax probably will take you only a few days to understand. For this, the official Microsoft .NET resources are some of the best, and are where I started. My suggestion is to begin by taking a manageable project and tackling it head-on.
“I would recommend to first…start with a simple program,” Činčura says. “Don’t try to start with a web application…Start with simple stuff like a console app and get yourself familiar with the language, the ecosystem, with the tools.”
I chose a classic example for learning object-oriented programming, a point-of-sale system for a fictional movie rental chain called MovieWorld. I began by setting goals and asking some basic questions to guide the project:
- What should this application do? It should allow someone to manage customers, their rentals and what movies are in stock.
- How should the application function? Orders involve one customer and multiple movies. Movies can be new releases or standard – and so on.
- Where should I start? Begin with a simple command-line app to get started, and work toward your goal based on the questions you answer.
“The way I learned…pick a manageable task you can bite off…a simple app…just envision something you want to build,” says Christian Findlay, an Australia-based C# expert who develops software and content. “Maybe write down how it should work…and then go through the process of making it happen. In that process, you’ll have lots of questions. Reaching out to the community is going to be your best way to learn and get feedback about how to do things.”
Early on, it may be harder to Google your questions, so resources like Stack Overflow and the Learn C# subreddit can be very helpful. While the internet can be notoriously tough on beginning programmers, the C# community tends to be quite welcoming.
Some of the biggest challenges come not from learning the language and syntax, but when understanding best practices and the C# ecosystem as a whole.
“Lately there is a lot of stuff happening in the .NET ecosystem. It must be difficult for the newcomers to keep an eye on everything,” Činčura says.
As you work on a pet project to hone your skills and gain a deeper understanding of C#, you can find answers to your questions and get help from books, tutorials and modern hybrid tutorial/hands-on systems. Findlay recommends Katacoda by O’Reilly, which he uses.
“You can log in to the browser, it will give you a command prompt and a file editor, and you can go in and type the code and run the code directly inside the browser,” Findlay says. “Those kinds of tutorials…give you an introduction to the language…but also give you a chance to try it out, all in the same place.”
Most of us who decide to explore a new skill want to know how long it will take to learn. As for C#, how quickly you’ll pick up the language depends on factors including whether you’ve done any programming before. Are you proficient in another programming language? Do you know how to use a computer?
“If you have experience programming…it would take you a week to learn C#. One week, really,” Činčura says. “It’s not a difficult language. You don’t have to know all the bells and whistles. Basically in a week you can start writing code.”
If you’re new to programming, you can certainly start with C#, but the language isn’t what’s important – understanding the fundamentals is essential, and it shouldn’t take you long to master the key concepts. When starting C#, it can even be learned language agnostic, using what’s known as “pseudocode” to understand the logical patterns and basic ideas that apply to all programming languages.These core concepts can be learned in as quickly as one day. Applying C# to them and actually writing simple code can be accomplished within a couple of weeks, depending on how much time you dedicate to learning.
If you have experience with other programming languages, C# should be relatively easy to pick up syntactically. However, learning the ecosystem and best practices will take some time. This is the part that has been most difficult for me – understanding the “C# way” of doing things. I learned to navigate the language by getting involved in the C# community, reading articles and putting my own code out there to be critiqued.
“Put your code in a public place like GitHub or Stack Overflow and say, ‘I’ve done this. How would I improve this?’…That’s something that will allow you to keep learning and improving the rest of your life,” Findlay says. “You’re looking at a long journey, but it doesn’t necessarily mean that you can’t be developing something right now.”
You can build almost anything with C#. While it’s most commonly used for web, desktop applications and game development, frameworks like Xamarin are broadening the horizons for C# as a language for mobile development.
C# is also a strong player in the world of cross-platform development – writing code that can run on all systems. Frameworks like Uno make that possible.
“More and more, these technologies have been running across different form factors like phones, and now it’s moving to the browser as well,” Findlay says. “The future as I see…is really about cross-platform app development.”
If you want to become a proficient C# programmer, you’ll need to take time to dabble, then more time to perfect. It may not be necessary to take courses or read textbooks, but what’s most important is working at it regularly and always wanting to learn more, not just doing the same thing over and over again.
“It took a lot of evenings and weekends to basically play with something,” Činčura says. “I completely understand that there are people…who don’t do programming in the evening. That’s fine, but don’t pretend that you’re going to be a great developer. If you like it…just practice it.”
- W3Schools: This is an invaluable resource for examples, tutorials, quizzes and exercises on C#.
- TutorialsTeacher: This site contains information on C# programming and a lot of free tutorials.
- Christian Findlay on Katacoda: Findlay’s resources here are excellent for understanding C# basics and getting started quickly.
- freeCodeCamp.org on YouTube – freeCodeCamp.org provides nearly unlimited resources on programming, and the videos on C# are excellent.