Top 5 reasons to use C#

by Kenji Elzerman
Top 5 reasons to use C# - Kens Learning Curve

There are many reasons to use a particular programming language. All languages have their own pros and cons. It’s also a personal choice or because you have grown into it. Or maybe you need to achieve something specific that can only be done with that language. For me, that is C#. I have been using it for many years and noticed you can do a lot with it. From desktop applications to microservices in the Cloud; C# can do it. But why? Why do I use C#? Well, here are my top 5 reasons why you should use C#.

That doesn’t mean there aren’t other languages that can compete with C#. But since I have been using C# for over 20 years it’s hard to learn a new one (although I am working with Python lately, don’t tell anyone).

1: Object-Oriented

Using objects is pretty common these days and was a big deal when it was introduced. C# is all about objects and it works really nicely. It gives you more control of your code and how you address data.

Besides that, object-oriented programming – or OOP for short – gives you the opportunity to reuse code because it’s more modular. And this helps to solve the duplicate code violation.

Other reasons why OOP is important are polymorphism, abstraction, and inheritance. I could write a lot of these topics, but that’s not really the idea of this article.

I remember working for an organization that had software written in 1977 (I am from 1982, go figure). It was written in Basic2C and it basically was just one file, because methods, classes, and objects didn’t exist. When we were done, the original developer of the Basic2C application looked at the code and said that he wanted to have this in 1977. The code was nicely organized in classes and folders. The duplicate code was removed and the application was made for expansion.

I can’t think of a world (or C#) without objects and all the perks that come with them. That is why this one is number one of my top 5 reasons to use C#.

2: Cross-platform

One of the biggest problems we, developers, have is the different platforms. We have Windows, Linux, Android, iPhone, macOS, and everything in between. Creating software that needs to work on all platforms (and the software, like a browser, on that platform) is a nightmare. More and more programming languages are getting cross-platform, meaning you code once and run it on different platforms.

Okay, to be honest; Microsoft was a bit late to the party if it comes to cross-platform. But finally, we got it. I can now use C#, with .NET, to create a mobile app that runs on Android, iPhone, and Windows mobile. At the same time, that app can also run on Windows and Linux. It is called MAUI and is pretty new. But even before MAUI, it was possible to create Linux software with C#.

This is one of the main reasons I use C#. Cross-platform is getting easier every time with C# and the .NET framework.

3: Multipurpose

Sometimes people ask me what I have made with C#. Well, actually everything. From a simple Windows application to a full website with cloud possibilities. Cool, huh? But that is not all that you can create with C#.

Here is a “small” list of projects you can create with C#:

  • Windows application
  • Websites
  • REST API
  • Mobile apps
  • Games
  • Cloud services
  • Windows services
  • IoT apps
  • AI and machine learning
  • AR and VR
  • Automation scripts/tools
  • GIS

And maybe I forgot a few, but I think you got the point.

I didn’t create all the types, since each project type is a different ballgame. But when I learned that C# can be used to create games, I installed Unity and tried it out. It was perfect. The combination of a GUI allows you to drag and drop all items you want to use. Then you use the C# code so the items in the game can be controlled. In the end, the game can run on multiple platforms, even Oculus Quest, which I have.

4: Asynchronous programming

C# is a big fan of asynchronous programming, making it easier to write responsive and scalable applications. It’s a way to create code that runs in the background and doesn’t block other parts of your application. It can really help improve the performance of your apps because it can multitask.

By using asynchronous programming in C#, you can write applications that are more responsive, scalable, and efficient, making them better suited for today’s high-performance computing environments.

In C#, asynchronous programming is achieved using the “async” and “await” keywords, which allow you to write asynchronous code in a way that is similar to writing synchronous code. The basic idea is that you use the “async” keyword to declare a method as asynchronous, and then use the “await” keyword to specify which operations should run asynchronously.

5: Visual Studio

When I started with Microsoft development, I used ASP classic and was introduced to Visual Studio 2005, which was launched in November 2005. I didn’t like it. I was used to UltraEdit for PHP and Visual Studio was a totally different game. I just didn’t like it and I can’t really think of a reason why, just a feeling.

It’s 2023 and I love Visual Studio. It has grown in so many ways. The free version (community) is a really big IDE with a lot of functionality and I can do everything I need. And if it’s not in Visual Studio Community, someone has made an extension for it.

Although more and more people head over (or actually head back) to the CLI, I keep using Visual Studio. With just a few clicks I have my API created and running. I can easily debug the code, find all kinds of information about my app, deploy my apps to the cloud, and much much more.

The design has become increasingly better over the years. IntelliSense has grown too, giving us a better idea of how we can use objects, classes, and libraries.

Although the RAM usage is a bit disappointing. Sometimes it uses 4 GB and on a laptop that isn’t really convenient. Updates are usually over 1GB and because I am usually in hotels, updating is a @*&^!*. But this is more of a Microsoft thing because Windows updates are commonly over 2GB.

From one IDE I can create everything I want. Just by selecting, clicking, and some configuration.

Conclusion

Well, there you have it; my top 5 reasons why I use C#. As you can see/read C# can be used for a lot of things. Especially if you combine it with the .NET framework. Together they are very powerful.

That doesn’t mean other languages can’t do the same. In fact, there are languages that could be better in some cases for particular scenarios. Yes, you can use C# on Linux, but I prefer Python on my Raspberry PI. Yes, you can build a website with C#, but I rather use PHP or Angular. I mainly use C# for the back end, holding and managing the logic and storage (databases for example).

But with Blazor and MAUI being relatively new players I might use those rather than PHP or Angular. Mainly because now I have dozens of programs to create and manage all the different projects I have. Visual Studio Code did resolve that mostly because it allows you to install plugins/extensions for different languages. I use Visual Studio Code for Angular, Python, Arduino, and PHP.

So, what’s my take on Java? Well, it looks nice and can do a lot. C# and Java are almost the same but have different histories. They are both OOP and support similar programming paradigms and features, including encapsulation, inheritance, polymorphism, and more. The big differences are the syntax, libraries, and more. But is Java really that different? Should C#’ers “hate” Java-people? Nah, both have pros and cons.

Still, choose what you think is best and suits you the most. Maybe these 5 reasons help you decide, maybe not. What is your opinion of C#? Or do you love another language for particular reasons? Let me know in the comments!

You may also like

Table Of Contents
Kens Learning Curve