Jump to content
  • Advertisement
Boder

C# Has C# replaced C++?

Recommended Posts

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. 

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites
Posted (edited)
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.

Edited by Lucrecious

Share this post


Link to post
Share on other sites
 
 
 
 
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.

 

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.).

Share this post


Link to post
Share on other sites
Posted (edited)
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.

Edited by Nypyren

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!