Download

Comparative merits of new Mono C#, and C++ as they are implemented in UE4

Hi all, I will try to keep this one brief, and please forgive any misunderstandings that are surely caused by ignorance here, as my knowledge is quite limited.

I have a little experience with C# scripting within Unity, and have a feel for how that object-oriented programming workflow goes.

I am now considering whether I should pick up C++ (probably the task of just under a year I would imagine) in order to code within the UE4, or if C# as now offered will be able to continue to meet my needs in UE4.

I understand the traditional benefit of using a lower level language like C++ is stuff like control over memory allocation and management. Does C++ as implemented within UE4 still retain those native benefits?

And what about the new implementation of C# in UE4? I understand you currently need to obtain a license to use Mono with UE4, but excluding that aspect, are there any major disadvantages to using C# in this context? Would I be able to control aspects like destroying objects and dismissing them from memory without calling C++? I am anticipating a project with heavy performance constraints… am I tying a hand behind my back by considering the project in C#, rather than C++?

Any thoughts on these concepts, and any obvious ones I am overlooking due to ignorance are sought!

Ah bummer… this old topic again.

IMO (once again), you’re better off having a go at C++. C# AND C++ would both require you to learn the way the engine works and it’s API, but C++ is much more supported and you’re more likely to get help with it. This is the best thread for answers atm IMO, but it’s still full of C# and C++ warriors thrashing it out.

In Unreal, programming in C++ is always going to give you more freedom. C# will still only ever be able to act as an interface between C# and the native C++. It’s also worth noting that unless you’re doing anything out the ordinary, you can pretty much expect the engine to handle memory management for you (great for newbs like me!)

Apologies if this feels like I’m jumping at you, the instant I see C# and C++ in the same forum topic title I know a flamewar is inbound :stuck_out_tongue:

Sad to say, I am actually curious to witness the forecasted flamewar, if only because I haven’t seen it yet in the context of Unreal, and am curious what ammunition stalwarts on either side have against one another. I do have to admit, the 5-second compile time in Unity C# as mentioned in that thread is nice, but oh well.

That aside, you gave the answer I would have expected, and probably the true one as far as I can tell. I figured Mono in Unreal might be too young for a near-beginner to touch unsupported. Looks like it is time I hit the books again.

And no worries man, you gave decent information all the same, and I know how tiring repeat threads can get, but google wasn’t helpful at dredging anything up so I figured I would have a go at it here.