First off, I would like to say, “Happy Anniversary, .NET!” for being born 20 years ago and growing up as a fine software platform. I congratulate Microsoft for creating the most loved framework among developers. But while I am toasting my wine glass for .NET, I also raise my cup to C#, the programming language which could have very well carried the success of .NET. There is a proverb that says “A Chain is only As Strong As Its Weakest Link”, and, in the case of .NET and C#, I say, a programming framework is only as good as its programming language.
In this article, I will show you how popular C# has become in the span of twenty years from the time of its inception, what aspects of C# kept it relevant and fun to work with, and most importantly, why it will become the most popular programming language by 2035!
The rise of C#
Twenty years ago when Microsoft released .NET and C#, Java was already dominating the programming world, and had already superseded C/C++ as the most sought after programming language. It is easy to understand why.
Java solved two ubiquitous problems in software development that C++ has always been criticized for – portability and pointers. Java is cross-platform and has garbage collection. Its promise of the “Write Once Run Anywhere” code was hard for companies to ignore both on the cost and time standpoints – you could write a Java code once and run the same code on Windows, OSX, Linux or any other operating system (as long as a Java Virtual Machine or JVM is implemented in that operating system). Secondly, the built-in garbage collection removed the burden of memory management away from the programmer, thereby eliminating, or at the least reducing bugs related to memory leaks.
C# was born out of Microsoft’s long desire to have a proprietary language that had the soul of Java. In the year 2002, Microsoft released the .NET Framework and C# became its primary language. Like Java, C# compiles to a type of bytecode called Common Intermediate Language or CIL and executes in a type of virtual machine called Common Language Runtime. And like, Java, C# has garbage collection. Microsoft seemed to have found the perfect language for its platform.
C# became popular in its first year, thanks Microsoft’s influence in the industry, and the already widely used Visual Studio and Active Server Pages. Take a look at the line chart that I created to illustrate the rise of C# since 2002.
Observe the path that C# took from 2000(before it existed) to 2021. At the end of 2021, C# has become the fourth or fifth most popular language in the world, without a sign of trending downward. In fact, it has trended in a positive direction – slowly but surely in an upward trend.
On the other hand, Java has been trending downward in the last five years or so. Java has held on to the #1 spot for a long long time until Python took over the top spot sometime between 2015 and 2020, and has held on to that spot till the end of 2021. Just check out the gap between Java and C# in 2000 and then the gap in 2021. What a difference! C# has really come a long way as a programming language in terms of popularity.
What would it take for C# to continue its positive run? Does it have what it takes to topple Python out of its top spot in the future? This is a question I will try to answer in this article.
Things that has kept C# relevant
I believe that these are the reasons C# stayed relevant in the last two decades:
The Microsoft company
Honestly, I could stop right here and say Microsoft is one big reason why C# is still here, but that’s no fun, and seriously, that’s probably not in the least true. But I could say that one big reason why C# has stayed relevant all these years is it has the backing and support of Microsoft – arguably one of the most important companies in the digital age who has a market cap of $1.8 Trillion, and whose Windows is installed in around 75% of all desktops and laptops in the world.
You could argue that a Microsoft name stamped on a product is not always a guarantee of success. After all, Microsoft had failed in some of their endeavors such as Windows Phone, Lumia Phone, Band smartwatch, Zune music player, Groove Music streaming service, and Cortana Smart Speaker. The problem was that Microsoft obviously entered into markets that it was already lagging behind. Apple, its longtime foe, was already lightyears ahead with iPod, iPhone, and even smart watches. Microsoft couldn’t even take a bite of the pie shares of Korean phone makers. Smart speakers were no different either – Amazon and Google had already built brand names before Microsoft decided it wanted that market as well.
But .NET as a software is different – software is Microsoft’s domain and software is where it excels the best. Which takes us to the next reason why C# has stayed relevant, and it is .NET.
ASP.NET is at the heart of .NET, Microsoft’s unified development platform, and C# is at the heart of ASP.NET. The things that you can do with ASP.NET are endless – desktop, web, mobile, the cloud, gaming, AI, IoT, and many more. .NET’s ecosystem includes free IDEs like Visual Studio, web servers like Kestrel, databases like SQL Server or Express, Git repository platforms like GitHub, and hundreds if not thousands of libraries and packages for all types of applications.
I am in the opinion that .NET (and C# for that matter) has been the most important product that Microsoft has ever developed in the last 20 years, and the second most important in Microsoft’s existence(Windows being the most important). As a software developer myself who became a Visual Studio programmer for the first time in 1998, the release of .NET Framework in the early 2000’s showed that Microsoft was no longer just a company that sells end products like operating systems for businesses but also one that provides a software platform for developers. Microsoft was serious in keeping the loyalty of its customer base and what a way to do that than through earning the trust of Windows developers.
The release of .NET Framework in 2002 was a game changer for Microsoft because it was Microsoft’s first software development platform, and it was the first implementation of the standardized Common Language Infrastructure(CIL), a bytecode, a low-level language that made Java programs platform-independent. To be clear though, .NET Framework is not open-source or cross-platform. It was never implemented or tested on any other systems except Windows, but Microsoft engineered the framework to follow the ECMA and ISO-approved specifications for CLI thereby opening the possibility of implementing .NET to run not only on Windows but also other platforms like Linux and macOS.
The good news is there is a cross-platform and open-source implementation of .NET Framework, and it is called Mono, a framework originally developed by Ximian and now maintained by Xamarin, the same company who developed Xamarin.Forms, a cross-platform framework for building mobile apps. As of today, the Mono framework has been widely used in various industries from client-server applications to stock market to gaming.For example, Novell uses it in their ZenWorks Suite, iFolder client server, Groupware Server, media player and photo management software. Medtronic uses MonoTouch and MonoDroid for all their mobile applications using C# as a single codebase. Unity Technologies, the creator of Unity engine, uses Mono and chose C# as the primary language to build libraries and to power everything the engine does.
The biggest milestone for .NET in terms of platform-independence came when .NET Core was released in 2016. It is open-source and is under MIT licenses and the autonomous .NET Foundation. It is cross–platform and runs on various platforms like Windows, macOS and Linux operating systems. From that point forward, other new .NET releases such as .NET 5 and .NET 6 are open-source and cross-platform. Furthermore, it’s important to note that with the support for microservices and Docker containers, not only is .NET cross-platform but also cross-language being able to blend different technologies together in your software – this means that you can make microservices developed with C# work seamlessly with microservices developed in Java, Ruby, and Python.
.NET has a variety of UI frameworks for C# developers, and these are such as Windows Forms(WinForms), Windows Presentation Foundation(WPF), Universal Windows Platform(UWP), WinUI 3.0. A new framework called .NET MAUI(Multi-platform App UI) was introduced for .NET 6 and beyond. .NET MAUI is an open-source and cross-platform framework for creating not only desktop but also native mobile apps.
In addition to Microsoft proprietary framework, there are also third-party UI frameworks. One of the most popular ones is called Uno Platform, which is a desktop, web and mobile framework that uses C#, XAML and WinUI. Another is Avalonia UI,which includes support for WASM.
C# is an excellent programming language when it comes to building web applications. In fact, it is the primary language used for the ASP.NET web framework for building web applications like Razor Pages, Web API, MVC SignalR, gRPC, Blazor Server and WebAssembly. Furthermore, adding data access into your application is a breeze with a EntityFramework, allowing you to use any database service available in the market today.
In today’s mobile-centric world, various frameworks have been created to make mobile development simpler, quicker, and cros-platform. You can code natively for Android using Java/Kotlin, or for iOS using Swift. But cross-platform frameworks have become popular over recent years eliminating the need to port from Android to iOS, and vice-versa. With a multi-platform framework, you have a single codebase that can run on different platforms.
Some of the most popular cross-platform frameworks around include React Native, Dart/Flutter, and Microsoft’s owned Xamarin. Other frameworks include Ionic, Capacitor and Electron.
The .NET platform has a mobile platform layer on top of it called Xamarin for building mobile apps that run on iOS and Android. The Xamarin platform uses a framework called, Xamarin.Forms which uses XAML for markup and C# as the code-behind. As of this writing, it is used extensively in various industries by organizations like UPS, Academy of Motion Pictures Arts and Sciences, Alaska Airlines, BBVA, American Cancer Society, Outback Steakhouse, to name a few.
Things that will propel C# to the top
I give you 4 reasons why my bold prediction will come true:
The term simple to learn has never been attached in any shape or form to C#. Just go back to .NET Framework or even .NET Core, and you can see how many lines of code or namespaces you need to add to create a simple Hello World program, console or API.
Back in the days of Assembly, Pascal and C, it was widely-accepted that “computer programming” was tough and complex. For low-level programming, in particular, the pejorative term “spaghetti code” would evoke friendly jibes but not shameful scorn. Bootstrapping your code with endless ceremonials was as natural as preparing a sandwich for lunch.
In the same spirit, there was a time when C++ was the most popular language among developers, including myself. Pointers, #defines and externs notwithstanding, C++ powered the world of middlewares and embedded systems. However, the wind of change swept through the land, and at the end of 1990’s, Java took that title away from C++ as Java became more sought-after by businesses and developers for ease of use. One of the criticisms about C++ was how “hard” C++. As a C++ programmer in the 1990s to early 2000s, I never quite understood this until I became a C# (a Java-like language) programmer myself years later – C# was SO EASY to learn.
But once again, the winds of change were brewing. The internet revolution, once associated with the macroscopic consumption of digital information, has now been defined by new technologies that could process that data, not for human consumption, but for machine learning in their microscopic universe. The Internet of Things(IoT) created a slew of profiteering companies scrambling to make new smart devices like smartphones, home appliances and cars. All of a sudden, the industry needed a new kind of software tools that developers can learn quickly in a short amount of time.
Make it simple, stupid! It’s an inescapable chant that Microsoft could not escape from, and one that the company faced head-on, and somewhat succeeded with .NET 5 and beyond! Let’s talk about these changes namely, top-level statements and minimal API.
C# has gotten a LOT easier beginning with .NET 5, with the introduction of the top-level statements, which enable you to avoid extra ceremony required by placing your program’s entry point in a static method in a class
static void Main(string args)
With top-level statements feature, the code above can be shortened to this one liner, shown below:
And below is the Hello Word code in Python:
print("This line will be printed.")
As you can see in the C# code, the new feature allows you to strip off the using directive, namespace, class, and Main() method. And you’re left with the code that matters. With this feature, .NET comes closer to the simplicity that made Python or NodeJS popular. Indeed, according to Microsoft, “top-level statements” is a feature brought to .NET 5 as a means for accelerating adoption and learning of C# .
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.MapGet("/hello_world", () => "Hello World!");
This GET API only contains 4 lines inside Program.cs, our main program file. Compare this to Flask’s Hello World API below:
from flask import Flask
app = Flask(app = Flask(__name__)
return 'Hello World'
And then, compare to ExpressJS below:
const express = require('express');
const app = express();
const port = 5000;
console.log('listen port 8000');
Web browser execution
The web browser is the future of C#. Let me be more specific: WebAssembly or WASM is the future of C#. A bold statement, yes, but compared to my 2035 prediction, this is mild.
The significance of this for C# can’t be emphasized enough. This means that developers can now use C# (or any other general-purpose programming language) to develop performance-intensive applications like computer graphics and music streaming that target the client browser. This capability may be true with other languages as well, however, with Microsoft .NET ecosystem, C# has a bigger advantage.
C# is THE language that’s used in Unity. Developed by Unity Technologies, Unity is probably the most widely used game engine in the industry not only in gaming, but also film, engineering, military and design.
According to Harrison Ferrone, a software engineer, game developer, and author of book, “Learning C# by Developing Games with Unity 2019”, said in an interview in 2019,
The world is moving towards cloud computing in a quick manner. In fact, Microsoft’s biggest revenue comes from Azure cloud business, which grows 32% yearly, and almost 50% for the first quarter of 2022. The fact that ASP.NET is fully integrated with Azure can’t be emphasized enough. In the words of Microsoft in its Azure selling point , “Build modern, scalable cloud apps on a cloud platform designed for .NET”. This is important because ASP.NET applications are natively supported by Azure services. Visual Studio, an indispensable tool, for .NET developers, is itself tightly integrated with Azure, which facilitates the development and deployment of C# applications into Azure. This means that C# will be ubiquitous in Azure products such AI, ML, serverless computing, IoT, DevOps, Containers, and many more.
Håkon Hapnes Strand, a Norwegian data scientist and Chief Technology Officer at Sklls.ai, and whose writings on machine learning and AI have been published in Newsweek, Forbes and HuffPost, said it best:
In principle, C# doesn’t hold a privileged position in Azure. It’s simply one of several programming languages that are supported on the platform.
In practice, C# is a natural first choice when developing solutions in Azure. Since it’s Microsoft’s flagship language, it’s well supported in most Azure services. Many services offer deeper integration with C# than with other languages. There is also extensive tooling for Azure in Visual Studio and Visual Studio Code that works very well with C#. Together, they make up an incredibly powerful toolchain.
The 4 things I mentioned above might not sound compelling to warrant a first place in popularity contest, but with C# powering all facets of applications from desktop to web, from mobile to IoT, and from gaming to cloud computing, C# truly can do much more now than it ever has – and this is why C# will become THE top programming language by 2035!
If it doesn’t, well… by that time my C# tutorials should be heads and shoulders above my expertise in fortune-telling, and that’s still a win for C#.