This is a more general question relating to game development. Right now I’m in a University and I’m majoring in game development, and over this summer break I planned on practicing C++ since I’m pretty sure that’s what most of my studies will be related to from now on. That, and I’ve always heard that “you must know C++ if you want to go into game development.” I recall some students there using Unity for their games and from what I see, C# and Javascript (or Unityscript as I’ve seen it called) are two of the languages in usable in the engine. After seeing a lot of resources for Unity, I decided that I also wanted to try learning to use it to create my own projects, but I’m not sure if I should focus on C# or Unityscript.
I’ve done about 4-5 months of Python (from my intro to computer science classes) so I’m still very inexperienced. I really want to learn to use Unity early on, but I also want to make sure I stay ahead of the game in my actual studies. What would be the best thing for me to do so that I don’t overwhelm myself down the line?
EDIT: I’m also wondering if I would need to learn the basics of the language(s) before trying to learn how to use them in Unity. Also, should I download Unity 3 for learning or would Unity 4 be just as good?
“You must know C++ if you want to go into game development” - Correct wrt Game programming in general and if you are looking for a job at a major game studio but not required for unity except for plugins.
But if you want to listen to this old geezer’s advice learn C# first before you go into C++.
I’m with Mr.T on that one… C# is the first thing you need to learn, it can be a little intimidating at first, but once you get the basics, is a lot of fun. And there are a lot of things you can do with C# besides gaming.
/me: was about to say something about having learned C++ before C#, but then remembered he learned OOP in Java first.
Yep, a managed language is a good way to learn Object Oriented Programming. And C# is better than Java (not to be confused with Javascript or Unityscript) for a variety of reasons. So I’m gonna echo what others have said, go with C# first, and then move on to C++. But make sure you’ve got the basic OOP concepts nailed down before moving on.
As far as programming goes, maybe even take some time on down the road to learn some basic RISC assembly. This is purely for gaining a better understand of how things like the stack work though. One of my professors once told me “If you don’t know how it works, it might as well be magic. So you should always understand at least one level below your area of expertise.”
True story.
When I was 17 I wrote a simple wordprocessor in 6502 Assembler. A wordprocessor has complex text formatting routines and writing them in assembler was really hard. The main thing I learnt from the whole experience is that I should have used a higher level language rather than assembler. I’ve been a professional programmer for the last 20 years and never used Assembler since.
However, after college I went for my first job as a C programmer, programming Windows 3. Now Windows was quite new then and the guy hiring me didn’t know much about it and neither did I. But I told him about my Assembler experience and he knew that was a difficult thing to do so he hired me.
Fast forward to now. If you want to get stuff done and program your own games in Unity then learn C#. Unless you’re writing your own engine its great for 90% of what you want. However, if you want to impress an old guy who might be hiring you then learn C++.
Having said that, I would still say learn C# first…
I can’t see any reason not to use the latest Unity. As others have said, anyting you learn in c# will be useful in other languages, so your time will not be wasted.
I asked because I saw a lot of resources that were made for Unity 3 and thought maybe Unity 4 would be a little more complicated to learn if I use those resources. Mainly where certain things are and how to use them, not so much the programming side. On a side note, thank you all so much. Would it be better for me to learn C# basics first or find a tutorial that will teach C# basics and using them in Unity? I believe the site’s modules teach that.
The rest of it is the same as Unity 3. Most of the tutorials that you see out there might be for older unity versions but usually they will work with Unity 4 as well.
When you are learning, it is positive and helpful to see stuff work(results) and having something useful to apply it to. As the others said c# is a good choice, and what you learn in the process will be 90% of what you need for any lang really.
Once you get solid with coding/OOP in general, syntax and language specifics become trivial. And with game dev, its important to be flexible. On any given day, I could be using any of a dozen or more languages, my last project (see sig) leverages about 8 different techs/langs, (not counting servers) in the pipeline and engine. Once you get good at it, its all just code, don’t sweat too much about which one you start with, its all learning.
As a very long time c++ programmer, I feel c# destroys c++ in every way that matters, and should be aggressively adopted by game studios. Sadly, there’s still alot of prejudice and ignorance about c# in professional game development, and alot of old guard engineers using old c++ codebases, so righteous change doesn’t come as fast as c# developers would like. That being said, if you’re starting now, I still think c# is the way to go, by the time you get the skills/training/body of work to impress with your c++ skills, c++ will have declined more, and I think c# will be the top language. And you’d be competing with the old-school, very skilled c++ developers.
As others have said, the basic OOP stuff is the same in any modern language, so much of what you’d learn would be the same anyway.
Hehe, this one is a fun one (if what you meant by faster was performance), I’ve had many discussions with colleagues about this. C# is generally not faster, it’s getting better, but it’s not technically faster, or as fast. However, in the real world where developer time is not free, allowing me to get work done 2+ times faster and having more flexible/maintainable code makes it easier for me to dedicate time to optimizations, and I can do the big, clever optimizations that a compiler just can’t do. So, in practice it’s faster, just not something you see in small benchmark comparisons.
I recommend learning C++ first because it makes you a good ‘programmer’. Be careful of the diehard C# users in this forum who will tell you its the best thing since sliced bread. If you do decide on learning C#, you should learn C# outside of unity and then transfer your skills, as Unity breaks the rules per say and will teach you what is normally extremely bad habits.
I recall precisely the same arguments presented for C++ vs C (yea, I’m that old). Was wrong then, is wrong now. Learning a specific language will not change your programming skills, will just teach you the nuances of that language. Learning to drive a stick shift doesn’t help me at all now, and never made me a better driver, it’s just obsolete information.
I’ve nothing against C++, it had it’s day in the sun and was my language of choice for the vast majority of my career, but I know superiority when I see it. C# is designed for the modern age, where developers are expensive and fast CPUs are cheap.
Unity actually supports THREE languages, and all are valid choices for Game Development (I’ve used all three).
C# - Microsoft’s C style language loosely based on Java. It has many fans, but it is a very verbose language, and I personally can’t stand the syntax. Probably the best choice though if your end goal is work for someone else. But would not be my first choice to learn programming.
Unity Script - Unity’s proprietary C style language with JavaScript syntax. The syntax is a bit more wrist friendly then C# and tends to produce more readable code. While you’re learning Unity, this is probably a better choice than C#. Has more Unity specific documentation, and some features within the Unity environment that make it a bit easier to work with (You don’t have to wrap every script in a class or serialize variables to make them visible in the inspector for instance).
And contrary to what others have said, anything you learn while using Unity Script can be carried over to C# or Boo later. The game engine specific stuff and .NET will be more or less the same in all three languages, with slight tweaks to the syntax.
Boo - a .NET language with Python syntax. I consider this the best language available in Unity, since the syntax is even more readable and wrist friendly than Unity Script, and it is arguably more powerful than C#. Since you have prior python experience, you might want to try Boo. But I don’t generally recommend it to beginners, as there are a few quirks when working with the language, and it is poorly documented within Unity (but there is an entire site dedicated to the Boo language, and the Unity Script Reference does allow you to view Boo examples).
So basically, I’d choose the language you enjoy working with. Once your game is compiled, no one is going to know (or care) what language it is in.
Boo is actually based on C# and does not have all the functionality of C# implemented. In particular, one issue I ran into, you cannot define an anonymous lamda function as a parameter. It also, as of my last using of it outside of Unity, doesn’t support optional parameters. There are other issues as well (and the author of Boo discusses them on his site) as the language was largely developed to fit one person’s particular needs. The guy wrote it because he liked many of the features of .NET but preferred the Python syntax.
Boo is a valid choice, and Python syntax is easy on the eyes though.