🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Has C# replaced C++?

Started by
70 comments, last by Prototype 4 years, 10 months ago
6 minutes ago, Gnollrunner said:

However C++ still exists because there is a need for it.

This is fairly true. I'd say that you and @Lucrecious are both sorta right here: C++ is still a fairly in demand language/skill because it still remains the best performance-wise. That said, there are many cases where old codebases are written entirely in C++ and it's much more cost effective/easier just to maintain those bases than to port it all over to some other language. There's still a decent demand for Objective C programmers, which is surprising, given that Swift is essentially a replacement for Objective C (though I do believe there are some reasons to use Objective C, but don't quote me on this, since I'm not a mobile dev)

I'd definitely love to read/discuss this topic more, but I think it's fairly off topic here, so I'll refrain from adding more.

As for the actual thread topic, C++ and C# are both used to make games. Unity uses a variant of C#, many game engines make use of C++. I don't believe that game engines use languages other than C++, though there are probably some out there that do? Anyhow regardless, both are very useful languages. 

No one expects the Spanish Inquisition!

Advertisement
36 minutes ago, deltaKshatriya said:

I don't believe that game engines use languages other than C++, though there are probably some out there that do?

http://xenko.com/

Entirely C# (which is all i know about it)

3 minutes ago, JoeJ said:

http://xenko.com/

Entirely C# (which is all i know about it)

Huh, so there we are. A non C++ game engine. I'm sure more exist like it.

I personally would love to see a game engine written in Shakespeare. :D 

No one expects the Spanish Inquisition!

4 hours ago, TMII said:

I ask you kindly to refrain from such statements in the future.

I understand this discussion got a bit heated with C#/C++ already. I am ending this discussion from my side now with a last statement that such a trivial thing is not even nearly comparable switching between any other two languages, especially from or to C++.

Sorry, I didn't mean it to be offensive, it was just supposed to be a way to describe a view I felt was exactly what I said - simplistic. Even now you're asserting that enforcing virtual class methods is trivial when in reality that fact alone would make it easier to port from C++ to C# than from Java to C# (in fact, it's impossible to do a 1:1 port). And that's just one design difference.

3 hours ago, Gnollrunner said:

i.e. Cutting edge 3D games and other math intensive and mission critical software. It's all relative. If performance really isn't an issue we can write everything in Python.

If C# works for what you are doing then go ahead and use it.   I'm certainly not telling anyone what language they should program in. However C++ still exists because there is a need for it.

 

I mostly agree with what you've said.

I wasn't trying to imply that you were being dishonest, I just personally thought your take didn't tell the full story. You're not lying, I didn't mean to imply that, sorry!

For the record, I'm not much of a C# user, I just think it's designed a lot better than C++. I also feel that the hate for GC is mostly unfounded for most problems.

[Redacted](using unsafe pointers is a pretty easy way to avoid the GC in C# btw)

I fully agree about cutting edge 3D games - C# would be terrible for that, but that was also the exact problem I was talking about for C++. That being said, most of us aren't making cutting edge 3D games and that's why it's cool to use scripting languages or really any language you want.

All good.

 
 
 
 
On 8/22/2019 at 4:43 AM, TMII said:

Since C# was and still is a plain Java copy from Microsoft and since both have developed in parallel nearly in the same direction during the last ten years, I wonder what you are speaking about. Syntax, functionality and philosophy wise they are basically the same with a different naming scheme. 

That may have been true of C# 1.0 (nearly two decades ago!) but it hasn't been true for a very long time.

 

 

if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight

C++ will NEVER replace higher level languages such as C# or python. Just like those languages will NEVER replace C++.

Another argument to add to C# will never replace C++: C++ is a native language. Beyond video game development, it is one of the best (if not the best) programming language to use for making low level stuff like drivers, kernel modules, etc. While in C#, you can't use that for making those things since a C# written program requires an interpreter (which normally, can only be loaded after initializing the drivers and stuff.).

6 hours ago, TheIndieteurGuy said:

Another argument to add to C# will never replace C++: C++ is a native language. Beyond video game development, it is one of the best (if not the best) programming language to use for making low level stuff like drivers, kernel modules, etc. While in C#, you can't use that for making those things since a C# written program requires an interpreter (which normally, can only be loaded after initializing the drivers and stuff.).

This is misleading.  C# typically compiles to intermediate bytecode which then must be converted to native code in order to run on a processor.  However, you have the choice of whether you want to do the final native conversion at runtime (this is typically called just-in-time or "JIT") or do the conversion before shipping the product, which is typically called ahead-of-time or AOT compilation.

For example, if you use the Unity game engine, you have the option to use their "IL2CPP" conversion pipeline which produces native binaries on your build machines instead of on the end user devices.  We use this at work for our Android and iOS games.

You could theoretically take a native binary generated in this manner and use it for system drivers.  I know that Microsoft was researching this for a while.  I don't know if they ever decided to use it, though.

C# already replaced C++. You can learn C# and forget C++. And become successful in IT. C++ used only in several cases:
1) we want abnormally large amount of data on a single core/machine/memory and can not scaling horisontaly
2) SDK requirements
3) we realy need this milliseconds

2 hours ago, Nypyren said:

This is misleading.  C# typically compiles to intermediate bytecode which then must be converted to native code in order to run on a processor.  However, you have the choice of whether you want to do the final native conversion at runtime (this is typically called just-in-time or "JIT") or do the conversion before shipping the product, which is typically called ahead-of-time or AOT compilation.

For example, if you use the Unity game engine, you have the option to use their "IL2CPP" conversion pipeline which produces native binaries on your build machines instead of on the end user devices.  We use this at work for our Android and iOS games.

You could theoretically take a native binary generated in this manner and use it for system drivers.  I know that Microsoft was researching this for a while.  I don't know if they ever decided to use it, though.

My bad. The point I was trying to make is that C#, as it is designed, requires .NET framework to run while C++ doesn't require any of that.

And yes, I do know that there's a way to make drivers using C# but it is not recommended as the language was not created with that in mind. (https://stackoverflow.com/questions/994600/writing-drivers-in-c-sharp)

This topic is closed to new replies.

Advertisement