Honest question about C++ vs C#

Started by
11 comments, last by Nypyren 6 years, 11 months ago

My biggest interest is in the lifespan of software and I simply cannot see C# providing here in place of C++. For a start, Microsoft has already started doing weird things with .NET Core and in my opinion not handling the *important* legacy baggage of the language gracefully at all. Try compiling a .NET 1.1 program using the latest implementation of .NET and you will likely encounter problems.

Also, a game engine needs to access the operating system (you cannot avoid this). As such you will need to access C or C++ libraries. My solution is to just use C or C++ then and get on with my work. However if you choose something like Java or C#, you will need bindings. This is glue between the native code and your .NET or Java virtual machine. Bindings are always terribly maintained and unless you write your own, you will be at the whims of these bindings.

We have all heard of the saying "make games, not engines" but going one step further I would say "make engines, not binding layers". And that for the most part means that C++ is the absolute best choice.

However, if you just want to make a game, have fun and maybe make a bit of money then move on. You cannot beat products like Unity. In which case just learn whatever [great|terrible] language they enforce on you and get to work! :)

http://tinyurl.com/shewonyay - Thanks so much for those who voted on my GF's Competition Cosplay Entry for Cosplayzine. She won! I owe you all beers :)

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.
Advertisement

My biggest interest is in the lifespan of software and I simply cannot see C# providing here in place of C++. For a start, Microsoft has already started doing weird things with .NET Core and in my opinion not handling the *important* legacy baggage of the language gracefully at all. Try compiling a .NET 1.1 program using the latest implementation of .NET and you will likely encounter problems.

Also, a game engine needs to access the operating system (you cannot avoid this). As such you will need to access C or C++ libraries. My solution is to just use C or C++ then and get on with my work. However if you choose something like Java or C#, you will need bindings. This is glue between the native code and your .NET or Java virtual machine. Bindings are always terribly maintained and unless you write your own, you will be at the whims of these bindings.

Microsoft is pouring a lot more money into .NET than C++, and you will have a lot more trouble compiling that legacy Visual C++ 6.0 application in the latest VS than the C# 1.0 application, that's for sure.

C# doesn't technically need bindings to call OS functions, you just import them with P/Invoke and it's well documented how to do so for just about any function you might want. See e.g. http://www.pinvoke.net/ I have worked on various large-scale Windows software in .NET for many years and this is not an issue whatsoever.

Speaking of bindings, C# has such great bindings for Direct3D that I'd much rather use the bindings than the actual API!

My biggest interest is in the lifespan of software and I simply cannot see C# providing here in place of C++. For a start, Microsoft has already started doing weird things with .NET Core and in my opinion not handling the *important* legacy baggage of the language gracefully at all. Try compiling a .NET 1.1 program using the latest implementation of .NET and you will likely encounter problems.


There have definitely been some serious pain points between the fragmented .Net implementations. I worked on a Windows Phone 8 and Windows 8 port of a Unity mobile game and it was a major pain handling the three different sets of class libraries (Mono, WP8, "Metro" at the time).

Microsoft appears to have gotten sufficient feedback and has started a project called ".Net Standard" which will serve as a baseline for ALL .Net implementations. Ideally, this means that when I write a DLL for .Net Standard 2.0, I will be able to load that DLL in the next versions of Mono, .Net Framework, .Net Core, and Universal Windows Platform instead of the current hassles. It SEEMS like this will actually solve the problem the *right* way, but I'm crossing my fingers that the implementations actually function properly once they sort out the bugs, since I have already had trouble with .Net Standard 1.1 compatibility with UWP and .Net Framework.

This topic is closed to new replies.

Advertisement