Search Unity

Why can't we use C++?

Discussion in 'Scripting' started by unity_ug_L3iXXoXsm-g, Nov 14, 2017.

  1. unity_ug_L3iXXoXsm-g

    unity_ug_L3iXXoXsm-g

    Joined:
    Nov 14, 2017
    Posts:
    2
    Why doesn't unity use C++ instead of C#? C++ is the most widely used programming language. Most every job opening I see for programmers are for C++ experience.
    I know you can work around it and still use C++, but that's a hassle. I've seen many people complain about this for years. Any word of the creators of Unity itself about this subject?
     
  2. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    825
    IMHO what you gain in any potential performance game is then lost by readability and the speed at which you can create new features within your game. C# is a nice and simple managed language which allows for super quick creation of applications which is especially useful within games where iteration and prototyping is super important.

    A lot of people using Unity are beginners, using C++ would put a lot of people off because the learning curve is steeper and more error-prone.
     
  3. unity_ug_L3iXXoXsm-g

    unity_ug_L3iXXoXsm-g

    Joined:
    Nov 14, 2017
    Posts:
    2
    Yeah I understand that and I agree that it's a lot more user friendly, but still, the majority of game developers use C++, so I think it's kind of odd that Unity doesn't at least add the option. Would probably massively increase the amount of users too.
     
  4. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    825
    Got a source? I would be interested to take a look.
    Specifically for game programmers not engine developers etc.
     
  5. KelsoMRK

    KelsoMRK

    Joined:
    Jul 18, 2010
    Posts:
    5,539
    Goes both ways. I started using Unity specifically because I could write managed code.

    Also if you check out the Unite talk on the new entity component and job systems you'll see that they have managed C# code running at, or faster, than C++ code.

    They've already sunset their 2 other language options to focus efforts on making C# support first class. I'd prefer they continue down that path.

    I doubt that actually. Doesn't Unity already basically own the world? :)
     
  6. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
  7. nat42

    nat42

    Joined:
    Jun 10, 2017
    Posts:
    353
    Why is this posted in "Scripting", very few games or programmers (as far as I'm aware) choose C++ for "scripting".

    I think that's what the OP means by "I know you can work around it and still use C++, but that's a hassle."
     
    unity_ug_L3iXXoXsm-g likes this.
  8. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,188
    I know way back when I discovered Unity, I picked it because I knew c# from my days of developing windows forms, asp.net stuff, and other programs for windows.

    While it wouldn't bother me if they support c++ as well, I'd rather them focus on making c# the best it can be then try to spend research time on adding c++ in.

    Considering the broad amount of engines out there, there are quite a few languages being used in game development, so I'm happy with their choice.