Java vs C#

Let the Controversy begin!

Well, it's time for us to join the ranks of those who have discussed the clash of these two software titans, Java and C#. But before we dive in, I want to make a promise to you, the reader. I will at the end give my honest opinion on the two, as well as why, rather than taking the cheap and easy way out and say "Depends on what you want to do". Although, there is still a great deal of truth to that statement, my opinions aside.

C# and the .NET Family

I'm sure you've heard of Microsoft. They're pretty much everywhere you do, so it's hard not to at this point. This is even truer now than ever with so many recent acquisitions under their belt. Skype, LinkedIn, and most recently Github. And though they've had some issues getting into the mobile industry, it is undeniable that they absolutely dominate the world of personal computers. One of the staples of the Windows ecosystem is the .NET family of programming languages, the most powerful and popular of which is C#. While some software such as games may be built in more lower-level languages like C++ or C, most of the software available for Windows is written in C#.

C# is a compiled language, meaning the computer doesn't see what you type. The compiler 'translates' your code into something known as bytecode. This bytecode is read by something called the CLR, or "Common Language Runtime", that performs what is known as "just-in-time" compilation to translate the bytecode into machine-readable code. On older PC's, this could be an issue. But with the rapid pace at which technology continues to improve, this isn't much of an issue these days.

For the longest time, C# could only be used on the Windows platform. But a few years back, Microsoft made the decision to open-source the C# language and something called the .NET Core, meaning applications can be built in C# and ran on other platforms, including Linux and Mac OS. Moreover, there is something called Xamarin that allows you to build iOS and Android applications in C#, using a single codebase. I'm sure even you non-developers can imagine how this would be a huge time-saving feature.

And then there's Java

Java actually inspired Microsoft to create the C# language. Similarly, it is compiled down to it's own bytecode that runs on something called the JVM, or Java Virtual Machine. The JVM is available for Linux, Mac, Windows, and Java is even used for Android app development, desktop software, even web applications.

Now C# can also be used for web apps, but Windows Server hosting can be extremely costly. And while there is still the ability to run .NET Core on cheaper Linux alternatives, there are a number of limitations. Java, on the other hand, is completely open source. So no matter what you're building for, you have all of Java when you use it. Java also has its own set of languages in the JVM family, including a relatively new language named Kotlin that has been gaining a LOT of popularity lately. Kotlin can even be used for Android development, as well as any other places the JVM is being used.

DVD players, small electronic components that run your car or household appliances, even the International Space Station used Java, (and Linux, if I may fan-boy out) so it really is everywhere. Even more so than Windows.

So which should you choose?

Now, this is just my opinion, but I'd say this. If you're going to be working ON windows and FOR windows ONLY, then sure, go C#. You'll get more out of it. But if you're building on literally any other platform, and FOR literally any other platform, or if you're building for multiple platforms INCLUDING Windows, then go Java hands down. Don't work with limits when you don't have to.