Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Is it better to learn C# or C++?

Discussion in 'General Discussion' started by WalkingDead, May 30, 2015.

  1. WalkingDead

    WalkingDead

    Guest

    I am new to this stuff and now started out learning it. I hope to get a job in the business sector where I live because C# is wildly in demand.

    Figured if I used Unity 5 to learn how to make games I would be very good knowledge and could perhaps show an employer what I have created in Unity 5 and it would work as an asset for me. I only have an advanced diploma in Computer studies from London which some call an ASc Degree in the states. But am hoping this along with good programming skills can get me a job over someone with a BSc but is not interested in programming and I know many folks like this.

    I have used BluePrints in UE4 but truth be told I feel as though nothing is really learned. I feel as though you sacrifice a great deal as opposed to using the actual programming language where it would automatically boost your ability to get a programming Job in the real world.

    Kinda like killing 2 birds with 1 stone.

    I know where I live C# is the number 1 most requested language for programming Jobs. I feel as though developing a game in Unity 5 with C# will greatly enhance my ability of finding a programming Job in C# for the future.

    however I heard if you know C++ then you know everything.
     
    Last edited by a moderator: May 30, 2015
  2. MasterSubby

    MasterSubby

    Joined:
    Sep 5, 2012
    Posts:
    252
    It depends on what end result your looking for. If you are looking to get a job with Unreal, or working in house on there engines, go C++. But I'm sure there are many factors to your decision, other than that. You certainly won't know it all from either.

    You said C# is wildly in demand where you live. Sounds like the decision is made. I go with C# because I'd take Unity and the ease of code structure any day. But you can always pick up on one or the other after your competent enough. I learned Unityscript first, and only took me 2-3 hours to understand what I was doing in C# after that. C++ and C# won't be as easy of a conversion, but it becomes miles easier to learn another language once you have one in your pocket.
     
  3. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    To develop for Unity C# is better.
     
  4. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,128
    Learn the languages you need as necessary. An experienced coder will generally pick up a new one in a matter of days.
     
    Last edited: May 30, 2015
    StarManta and angrypenguin like this.
  5. WalkingDead

    WalkingDead

    Guest

    Thanks dude
     
    MasterSubby likes this.
  6. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,509
    I suggest learning C# and using The Yellow Book to do it. It's a free book, and from what I've skimmed of it it's pretty awesome.

    One of the take home lessons from it is that you shouldn't learn a language so much as you should learn programming. That book teaches programming, and just happens to use C# as the language it uses to do so. It's a very good outlook, in my opinion.
     
  7. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    The best most gawdlike language in my opinion is C++. Compared to C#, C++ has greater functionality and performance, and about equal support. Unfortunately Unity doesn't support C++ even though it's written in that language.

    Since you're asking the question on UForums, I'd recommend C#. JS just seems suited for prototyping games but for hardcore scalable long-term stuff, it falls way short. Of course, C# and JS both got nufin' on Boo but Boo has next to zero support and will be fazed out soon :'(.
     
  8. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    It's already been phased out. Just nobody has bothered to delete the compiler.
     
  9. vx4

    vx4

    Joined:
    Dec 11, 2012
    Posts:
    179


    Technically,Unity support c++ via Plugins and since you can combine native c++ code and Managed code.YOU CAN PROGRAM IN C++..
     
  10. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    True. But I wouldn't suggest it for a first timer. Running C++ over C# in Unity is for people who know both languages and decide C++ suits their needs better.

    Not sure I agree here. Sure C++ has more lower level functionality. But for higher level functionality I'd pick C#.
     
  11. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    That is one of the reasons I like to recommend "Head First Java" (among others) to people who have trouble getting into programming. It's Java but it's more about what OOP is and what one should know to think like a programmer. The book itself teaches very little actual written code to be used for example programs but uses more of an approach to learn code without a computer.

    I'll definitely have a look at the yellow book now. Teachers who teach the understanding rather the the superficial worksteps always rank very high in my personal list of awesome. (And I think it'S the approach to gain a lot more from opposed to just learning steps and recipes) :)
     
  12. Korno

    Korno

    Joined:
    Oct 26, 2014
    Posts:
    518
    No. No. No. This is just wrong, sorry. There is no godlike language. What do you mean by functionality? APIs that support the language? Language features? Nearly all OOP languages have a similar language feature set and APIs really do depend on platform.

    Now, for a first language I would recommend c# mainly because it is more widely used in industry - business solutions, web via asp.ne and some game dev - mainly scripting. And it is more beginner friendly - garbage collection is done for you, memory management is not really an issue. If, however, you are interested in game development, engine development or performance critical, limited memory systems the c plus plus is probably your best bet.

    But really, You should be learning programming and design methodologies - Agile, UML, Unit testing etc. Then you should be learning design patterns - Observer, Factory, Composition. etc. These are language independent concepts. Learn them with whatever language you chose but learn them

    Languages can be learned quickly if you really understand programming concepts. The language is just a tool, the concepts you learn are your skill.
     
    Kiwasi likes this.
  13. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    They can't delete it cause IIRC UnityScript is built with boo :)
     
  14. Deleted User

    Deleted User

    Guest

    It's all the same really, knowing how to use the API that's the tough bit. If you know C# properly you should be able to understand enough to use C++.

    UE takes care of memory management unless you're doing something funky, so does C# with GC. It really doesn't matter as long as you understand how to program..
     
  15. WalkingDead

    WalkingDead

    Guest

    Thanks dude I will have a look at the yellow book

    I am very new to programming but sadly I do not have any math skills.

    Wonder how important mathematics is when developing games as a hobbyist?
     
  16. WalkingDead

    WalkingDead

    Guest

    Good friend I checked out the book and you are very correct. I am liking what I see.

    I am very new to programming.
     
    angrypenguin likes this.
  17. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    2,984
    There is no best language. You need to learn to program comfortably in multiple languages. Most of the programming concepts will apply to all languages. If you want to have job security, then learn C#, C++, C, VB, Java, etc. Also learn about HTML, PHP, and ASP.NET. Read books about programming, and practice programming everyday.
     
  18. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    Ah, sorry about not being clear. I usually think of functionality as control but that's the wrong word choice.

    There are just so many useful things that can be done with C++ but cannot be done or with C# (at least not easily). I.e.

    • Templating types. If I want to run tests on i.e. a physics engine to see if floats would suffice or double accuracy is needed, I'd want to be able to quickly switch the number type I'm using.
    • Explicit destructors. This is both a blessing and a curse. Personally, I think of it as a blessing because we usually have to consciously set things to null anyways to notify the garbage collector to destroy it in C# but with the explicit destructors in C++, we would be conscious about the performance impacts and have greater control over when objects are destroyed.
    • Explicit inlining. Working on a deterministic physics engine made me especially yearn for this features\. In C#, I had to use a bunch of tricks with refs because operators and functions couldn't be inlined (or at least didn't look like it in the profiler). Still, when implementing some kind of algorithm executed many times, passing on a 4 byte reference has high costs.
     
    Last edited: May 31, 2015
  19. WalkingDead

    WalkingDead

    Guest

    Guys I only have an Advanced Diploma in Computer Studies from London. (I live in the Caribbean) They call it an ASc degree in the states aswell. I am hoping if I could become very good at programming and learn as much languages as possible and show an employer a good project that I would have done in Unity 5 that this may allow me to have a job over someone with a BSc degree. (This is for the business sector, but a game should show I have a strong understanding of programming yeah?)

    Because I know a lot of folks with fancy BSc but truth be told they cannot develop software in the real world and were not able to keep a Job for long and were transferred to support and sales department etc. I also see programming Jobs being offered and the employer asks

    Requirements, BSc in Computer Science, Computer Engineering, Information Technology or a combination of less qualifications and added experience. So to me they value programmers who do not have a BSc but who is really good at programming and knows what they are doing.
     
  20. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    You always use the supported language of your platform. Unity is C#, Unreal is C++. You are likely not going to get good enough at coding to get a job in C++ / C# to use outside those engines or similarly restricted IDE UIs without more extensive training.
     
    Kiwasi likes this.
  21. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    If you have a CS degree, C++. CS degree means you like to play with pointers and other languages no more than 2 generations older than C.

    If you have an IT degree, C#. IT degree means you want the high level of whatever you're doing, and for .NET programming that means C# instead of C++.
     
    Kiwasi likes this.
  22. krazyhamad

    krazyhamad

    Joined:
    May 25, 2015
    Posts:
    12
    Well Sire,

    About C++ , its used in many areas but its not about a programming Language ..
    Its about Basics ... Like if you know Basics of Programming you can do good in any programming language ..

    Its like Learning to Drive ..
    If you have learnt to drive you can drive any vehicle with extra few days of work on that specific Vehicle ...
     
    Ryiah likes this.
  23. bestellenpreis

    bestellenpreis

    Joined:
    Mar 15, 2015
    Posts:
    26
    C or C++ would give you more direct control of the machine. C# targets a virtual machine, like Java, so I think it's not really what you're looking for.

    Your requirements are pretty vague, though, so you're not going to get much more than vague answers (and some spurious precision, ie, "You should absolutely use my favorite language, because it's the awesomest!")

    The two pieces of advice I'd give you: First, start in on straight C, without any of the C++ extensions, and learn that before adding in the C++ part. Get the meat before you get the (syntactic) sugar.

    Second: expand your goals. Writing programs to just run on your machine seems awfully limiting. Wouldn't it be a little bit fun to write stuff that other people could use?
     
  24. WalkingDead

    WalkingDead

    Guest

    Hi there good sir.

    Yes I have a IT degree where I did VB.NET and Structured Programming. Does one really need a Computer Science degree to be a programmer? can i show you the types of Jobs my country has that is currently being offered?

    http://www.caribbeanjobs.com/Digital-Media-IT-Associate-Job-62425.aspx

    and

    http://www.caribbeanjobs.com/Software-Developer-Resonance-Trinidad-Job-55510.aspx

    As you can see, "Familiar with programming languages, including .NET, Dynamic HTML, Java Script, HTML5, CSS and other web based language"

    Skills/Qualifications:

    - Good knowledge of C#, Java, SQL required
    - Knowledge of HTML, PHP, JavaScript is an asset


    My country does not have Jobs that require C++ or C. The Microsoft .NET with C# is the number one tech used here. You would think 3rd world countries would use open source but its not the case at all. Almost every business here is linked with Microsoft.

    Would you say C++ is a Job for Computer science grads and C# / Java are Jobs for IT grads?

    I did lots of Visual Basic .NET programming and Java in my IT Diplomas AKA ASc degree. There were no maths, just strictly programming and creating "Business Programs" for insurance companies etc. I will be honest, there is not a single game company here. Everything involves databases and creating GUI to connect to these databases.
     
    Last edited by a moderator: May 31, 2015
  25. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    @WalkingDead what I'm saying is that the focus of CS is theory and low level. The focus of IT is implementation, abstraction and high level. Take the CS version of an IT course or an IT version of a CS course, it's very obvious.

    Networking classes:
    IT420 - we had to learn what the advantages and disadvantages of some encoding and transmission methods and know how to use the already written libraries

    CS356 - we had to learn and implement the encoding methods and set up a network that maintained its own routing tables which were also written from scratch

    I didn't mention jobs at all, actually. In fact, browsing any job search site will let you know how uninformed some employers are on the difference between CS and IT. Lot's of jobs want a CS major for web development, database administration and other jobs that fall under IT specializations. I think that CS majors can do that work, but IT majors would have more implementation experience fresh out of college.


    On paper, the college courses for each major would suggest that.

    Sounds like what I did in IT302.
     
    Ryiah likes this.
  26. tiggus

    tiggus

    Joined:
    Sep 2, 2010
    Posts:
    1,240
    Based on the types of jobs you are looking for Javascript(and some js frameworks) and C#, it doesn't even seem like a discussion just read the job description.

    One of the keys is to really use it once you decide to learn it. Mastering a language can take a long time, but that's when it starts to get fun. Learning something and dabbling in it a few hours here or there is no good, gotta put the time in before you feel in control of it.

    That's why I clearly differentiate on my resume the languages I "know" versus the languages I am proficient in. Big difference to be able to talk about a language versus sit down and bang out a program in a reasonable time.
     
  27. WalkingDead

    WalkingDead

    Guest

    Thanks guys, I realize where I am from a CS degree isn't absolutely necessary.

    Would you all say creating a game in Unity 5 is like killing 2 birds with 1 stone? meaning would be useful to show an employer my programming skills? I assume having a finished game in Unity would be atleast somewhat an asset if applying for a Job dealing with programming?

    I feel as though we are in a great position today, visual studio is free, Unity 5 is free, so is UE4 and soon source engine 2. Yootheme allows use of the warp framework for free.

    I feel as though I must take advantage of this opportunity even though I don't have computer science and advanced maths. I feel as though I can get into making games with Unity, building websites, getting a Job in .NET for the business sector.

    I really don't want math to be something that holds me back. I am please to hear 99% of what we are doing here on unity is elementary school basic maths. I know up to high school maths.
     
    Last edited by a moderator: May 31, 2015
  28. tiggus

    tiggus

    Joined:
    Sep 2, 2010
    Posts:
    1,240
    I guess anything somewhat relevant is better than nothing but if I was looking for a job doing web frontends and C# I wouldn't be focusing on Unity, I would be building webapps which Unity is not going to give you. You need to decide whether you want a Unity job or a business dev job.
     
  29. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    Showing a game when applying for a software/web coding job is not really that good since it would require the interviewer to know whats involved in terms of coding with the tool you used as there are several game engines where you can slap stuff on screen and control it without any coding or skills.

    A working useful app released to one of the app markets or a website app using js frameworks/database connection would probably have multiple times more value and respect when applying.
     
    Kiwasi and tiggus like this.
  30. WalkingDead

    WalkingDead

    Guest

    ^ hey thanks, I will do as you suggest.

    But I still want to learn Unity in my free time and make a game to sell for profit. $200 US a month profit off a game sounds reasonable? if I built everything myself/
     
  31. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    Depends where are you selling them but generally $200 a month sounds very unrealistic no matter what engine or language used. You are competing with the hundreds of other games released weekly which are most also released as free with ads. Then trying to get the $200 with ads requires you to have very popular game and/or maybe spend money yourself on ad campaign to even get players.
     
  32. WalkingDead

    WalkingDead

    Guest

    ^ wow I had no idea making money off games was so difficult.

    I think I should focus on website design etc. Things I know for sure I can make money off because I do make more than $200 US a month building sites for people using Joomla.

    U guess using my programming skills in the business sector is a lot more profitable than games am i right?

    If one was to release a game on Unity and expect to make maybe $100 USD a month profit after google takes their cut. What is an example of such game you can show me? and is it even possible for 1 person to develop?

    I am getting the feeling folks here who develop these games themselves here do it for 0 profit and or just fun?
     
  33. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    Definitely. (Most) People don't make games to make big bucks. They do it because they love it.
     
  34. WalkingDead

    WalkingDead

    Guest

    ^ thanks man its a good thing you guys cleared this up for me. LOL

    I will instead focus my programming skills on things like Websites, Databases etc and learn to market myself for businesses so I can make a living.
     
  35. WalkingDead

    WalkingDead

    Guest

    Ostwind you told methat I am better off making "working useful app released to one of the app markets or a website app using js frameworks/database connection would probably have multiple times more value and respect when applying."

    Can you give me an example of what you speak off?

    I am dedicated to perusing this and taking your advice. I want to have something on the app market for an employer to look at when the time comes and also the js frameworks/database connection you talked about.

    Could you link me an example of what I should follow? that you think would be most beneficial to me when showing an employer?
     
  36. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    It's strange that there aren't more posts about that, because I do this all the time for my jobs. It's real nice on contract jobs where the programming side can show off how much you can accomplish on your own. It's especially useful of it's a .NET job because it'll show C# experience.

    For a job I just interviewed for that was related to database administration and java programming, I showed them a simple java console application I made to manipulate data in a local database. If you have enough skill, it might be enough to wow them and get you the job. Otherwise it's probably best to just butter them up and read into all of the software that they use. I had never heard of powerbuilder before that interview.

    "In May of 2015 SAP announced that Appeon would take over future development and marketing of PowerBuilder while Intellectual Property would remain with SAP.

    While Powerbuilder's market share has diminished, many applications created with it are still in use.
    "

    It's a dead and or dying tool. A revival effort is in place as of May this year. It's probably not as good as the million other tools for the job. But those guys like it so I faked some interest in it. There's a lot more to getting a job than your degree and relevant skills, sadly.
     
  37. WalkingDead

    WalkingDead

    Guest

    ^ hey yeah, to add to that I can tell you from real life friends, there is a girl who completed her BSc in Computer Science but she isn't working as a programmer she is in sales at an IT company, she could pass her exams but tell her to learn different languages in her free time and its the last thing that interests her.
    And I know a guy who has nothing but high school education but he is a self taught programmer. He has done so much contracts with companies that he now has his own company and pretty much makes more money than those with a MSc in Computer Science.

    In his own words, companies ask him all the time what can he do for them, how can he increase their profits. They never ask what are his math skills and what his grades in physics are.

    Which is why I suspect a lot of these IT jobs locally gives the option of 4 years experience in the software they are using as a substitute for a computer science degree. I am actually amazed at the weight that a lot of experience can carry.
     
  38. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    A good thing would be something you need yourself like what app you use weekly or daily. Make your own version of one with the features you only need and maybe add the ones you always wanted in the others. It does not matter if there are tons of same type apps with a lot of features. Making your own will show you are self-imposed and if the interviewers ask details you have reasons why you did this and that.

    I've seen a lot of applicants doings apps related their free time and etc, like mobile tracking apps for disc gold scoring, regional gas price, biking, health, photo gallery and so on. Some of them were mobile+webapp combinations so mobile sent the scores to database and website was accessibly by friends.
     
  39. WalkingDead

    WalkingDead

    Guest

    ^ thank you very much Ostwind, you have given me the advice I needed. This advice will go a long way for me.
     
  40. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    C++ is nearly mandatory for a programming job in the game industry I'd imagine.
     
  41. WalkingDead

    WalkingDead

    Guest

    well this thread turned out totally different from the title. LOL it stopped being about the OP a while ago. And more about me equipping myself for a Job by next year.
     
  42. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    Disagree. Strongly. Depends what engines the company uses. If they use Unity, then definitely not. Let's say I had my share of interviews at game companies despite being very clear that I know zero C++ and won't be learning it any time soon. They want to interview me because of my C# skills alone.

    About how much math is needed for a Unity programmer. Basically 4th grade math is the most advanced I've ever used so far. A lot of the math is "done for you" with Lerps and the like.
     
    Tomnnn and Ryiah like this.
  43. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    That's true. @hippocoder I had a game development job within the last year and a half. I wonder how many guesses you would need to guess that the job used actionscript for its games :D

    You don't need much. When you search for a particular function by describing what you need done, you find out what the algorithm is called and then download a library with its implementation. Or if you're a decent programmer the logical steps will be described well enough for you to write it yourself.
     
    Kiwasi and Ryiah like this.
  44. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Legend

    Joined:
    May 5, 2014
    Posts:
    1,445
    Nonsense. I've worked at Game Development companies, taught Game Development at University Academic level and now work at Unity Technologies; and I don't know any C++.

    Edit: Derp, read your comment again and noticed the 'programming' bit. My point still remains as I did/do programming in all three of those industry things I've referenced.
     
  45. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    I know C++

    I also know nothing, so that statement is obviously in-accurate.

    A more accurate statement would be, if you can figure out c++, the rest will be a piece of cake.
     
    Kiwasi and jpthek9 like this.
  46. garylinen

    garylinen

    Joined:
    Dec 19, 2019
    Posts:
    3
    C++ is C with classes added, and then a whole bunch of other things, and then some more stuff. It doesn't hold your hand, but it'll let you hold your own hand, with add-on GC, or RAII and smart-pointers. If there's something you want to accomplish, chances are there's a way to abuse the template system to give you a relatively easy syntax for it. (moreso with C++0x). This complexity also gives you the power to accidentally create a dozen instances of yourself and shoot them all in the foot.

    C# is Microsoft's stab at improving on C++ and Java. Tons of syntactical features, but no where near the complexity of C++. It runs in a full managed environment, so memory management is done for you. It does let you "get dirty" and use unsafe code if you need to, but it's not the default, and you have to do some work to shoot yourself.
     
    doarp likes this.