More recently I've been hearing rumors on the internet that C# is going the way of the dinosaur. That the .NET framework is just too fragmented (or is that .NET 6? or .NET Core?) and that newer "faster" front-end frameworks, like React and Vue.js are the way of the future.
Truthfully, those rumors have been around since 2002, when .NET 1.0 came out. If React wasn't going to take out C#, then Ruby sure was. And if not Ruby, then there was always Java to contend with. And since that time, C# has managed to survive its own supposed annihilation time and time again and rebuild itself.
Not only has it survived, but it's thrived really as it now spans multiple domains outside of just web development, such as Windows development, Android and iOS development and even game development.
Going into 2022 however, just how relevant is C# anymore? Is it a language destined to meet its untimely fate? Is React indeed taking over? And why should you care?
All that, and more, down below.
FYI, I have been a C# developer for over 15 years, so my perspective might be a bit biased. Read on.
A Brief History
Let's first start off with a brief history of C#, because it has definitely come a long way since its inception.
As mentioned above, C# was first introduced by Microsoft in 2002 as one of the primary languages of the .NET Framework along with it's sibling language VB.NET.
It had a strong resemblance to C++ and Java, which lead to some criticism at the time from the Java community.
It was developed by Anders Hejlsberg originally and is now managed by Mads Torgensen at Microsoft.
In 2005, C# 2.0 was released with features setting it apart from Java and thus giving it some much needed freedom.
C# has received several large updates since that time and is now in version 10.0 which is to be released along with .NET 6.
And if you go back even further, you have other more mature languages that have been around for decades longer and that are still in high use, such as C.
So in terms of popularity, C# is not at the top of the list currently. But it also isn't trailing behind in any major way.
StackOverflow's developer survey from 2021, puts C# at around #8 on the list, coming close behind on TypeScript.
There are some important things to point out on this graph however. For one, HTML and CSS are not programming languages. HTML is a markup language and CSS is a style sheet language used for describing the layout of an HTML document.
And that make sense to me, as professionally, those are the same languages that I have run into for almost 2 decades now in roughly that same order.
Let's take a closer look at just how C# is used in this modern age.
Used in Desktop and Web Development
C# was initially used to develop both web applications and Windows applications side-by-side using much of the same code.
This saved developers a huge amount of time as they could reuse much of the same logic and libraries across multiple platforms, as the code compiled down to the same intermediate language (IL).
Initially, web development was done through the ASP.NET framework using the Web Forms technology. The drag and drop frontend development was a big timer saver for developers as well at the time, as most web pages had very basic designs and CSS was not yet as mature in features.
Essentially, prebuilt web components could be dragged onto the canvas through a toolbar and events could be added to each element through it's properties window.
I personally started my web development career using ASP.NET Web Forms, and later on moved to .NET MVC. Though I personally still run active projects written using Web Forms because I still find alot of value in rapid development.
While Window Form development might not be as popular today as it once was, it is still very much used in professional software engineering fields. We still rely on desktop applications on a daily basis, even if we don't notice it.
Browsers, IDE's, database management tools, VPN tools and text editors are still much needed (and used) desktop applications for both developers and non developers alike.
Microsoft has since added more and more project templates to handle everything from API development to cross platform mobile development and even game development using the Unity Engine.
Mobile App Development
While no longer supported, at one time Microsoft also supported the development of Windows Mobile devices. I used to own a Windows mobile phone back in the day, and at that time, it was pretty awesome to see that tiny Windows button in the corner.
Microsoft has not given up on the mobile app development market however. Microsoft acquired the cross-platform development company Xamarin in 2016.
Xamarin allows developers to build out applications written in C#, meaning they can be deployed as web applications, that can also be compiled down to native Android and iOS code.
And that right there is huge. In the world of software development, cross platform development (good cross-platform development) is a unicorn these days. And that's because it's hard to keep the same standards across multiple different platforms with different release schedules.
In 2016, Microsoft also agreed to open-source the Xamarin SDK and to bundle the development environment into Visual Studio, which you can still find in all of the latest releases currently.
Unity Game Development
And if the language wasn't robust enough, C# is the primary scripting language used when developing applications running under the Unity engine.
Unity is one of the most popular real-time 3D and 2D development platforms currently on the market. The runtime code is written in C++ but all of development scripting is done in C#.
Unity can be used to develop everything from video games to simulations both in 2D and 3D using C# and .NET.
Around 50% of all video games currently published are built using Unity.
So, Is C# Dying?
Now that you have a bit more context on what C# is and what it's used for, I can give a better answer to the question proposed earlier.
Microsoft continuously pushes new updates to the language, which is currently on version 9.0 with 10.0 being released along with .NET 6.
Since its inception, companies at all levels, including governments, have used .NET to build their infrastructure. I know because I've worked at many of these companies during the span of my career.
You don't just build web applications with .NET. You build the foundation to your company many times with .NET. You build CRM systems, automated scripts, DLL libraries, console applications, mobile applications and you build them all using the same programming language, and often times even the same code.
C# might not be in the spotlight as of right now, unless you are actively looking in that direction. But it definitely hasn't taken a day off just yet and I can surmise that it will continue to get even more robust in the next few years, as quantum computing begins to hit the mainstream arena.
Walter Guevara is a software engineer, startup founder and currently teaches programming for a coding bootcamp. He is currently building things that don't yet exist.