Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

General Discussion

Joseph Frazer
Joseph Frazer
5,404 Points

C# vs. C++

What one should I choose? I'm thinking about making video games.

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,624 Points

Hey Joseph,

I can't give an opinion on C++ as I am not familiar with it. Treehouse does not offer any instruction on C++; however, it does have a Game Development Track with Unity that uses C# as well. So, if this is of interest with you, I'd recommend going through the Learn C# Track first and then moving to the Unity Track. Hope that helps some.

Good Luck and Keep Coding! :) :dizzy:

Bryn Price
seal-mask
.a{fill-rule:evenodd;}techdegree
Bryn Price
Full Stack JavaScript Techdegree Student 7,253 Points

This really depends on what you are wanting to use to make video games. There is so much out there, that it will depend entirely on what you want to use and why. Generally I would probably argue the language is less important than knowing how to actually code a video game and the processes and stages needed to do it. Sometimes it is not a case of C++ being more complicated than the other, for example, I found Leadwerks easier to get started with than XNA/Monogame, yet I was coding in C++ for Leadwerks and C# for XNA. And Dark GDK (precursor to App Game Kit) was super easy to work with in C++. However, that is from quite a limited experience, from back when I was trying to look for something to code in too, I tried lots of different things to see what worked for me.

But from a comparison of C# vs C++, C++ is a lower level language than C#, which means it will do less for you. As a result C++ is more complex and complicated to use. However, a well optimised C++ application will run better than a well optimised C# one and C++ gives you more control than C#. The performance difference between the two is less important these days.

But looking at some of the tools available to independents, hobbyists and learners (at least, what I've looked at): Unity 3D - Uses C#, which works extremely well with Unity3D's built in editor. Torque - Uses its own scripting language, but if you want to change engine code, you will be using C++ Leadwerks - Uses LUA for scripting and C++ for its core. App Game Kit - Tier 1 uses it's own take on BASIC, Tier 2 will use C++ Ogre - Built for C++, but has libraries that work in C# (but this is graphics library, you'd have to include a sound and physics one too) Irrlicht - Built for C++, but has libraries that work in C# (like Ogre, a graphics library) XNA/Monogame - Built for C# Unreal Engine - Most of the work is done in its editor and it has it's own visual scripting system, but if you want to go deeper, you will be looking at C++ Game Maker - Uses it's own language "GML"

There's ones out there that use JavaScript (like Phaser), Python (like Panda3D) and other languages.

But one of the most popular choices these days (for those outside of large game studios) is Unity3D and of course Treehouse offers a track for it. Having used it, I can see why it is popular, the C# script can be fantastic to work and integrates seamlessly with its editor, it supports major file formats (and works well with a good number of 3D animation software, even some of the cheaper ones) and its editor is not only very powerful but you can code in your own editor elements if you wish, to open up even more possibilities. It has a comprehensive asset store, should you need to grab assets, so you can focus on coding before you have your own assets figured out.

From a personal perspective, I have used most of the above I've listed. With the C# and C++ variations and C# is definitely easier to work with and results in fewer syntax errors and I find easier to debug. But also bear in mind, I was also a hobbyist and my games programming was mostly was before I was 20. But either way C# with Unity3D is a respectable choice and probably why Team Treehouse has a track on it. But worth looking around to see what you want out of it.

If you are looking to games program professionally, I would direct this at a games programming forum, or contacting a company direct and peruse their job ads, to see what they look for in a person. Which'll be better than my speculations that are based off of doing it as a hobby and the small handful of serious developers I ended up in contact with.

tlr;dr Unity is a good choice. There are plenty of choices of game engines and libraries out there before you decide to learn C# or C++ (or neither) but if you're looking professionally, the professionals are the best people to refer your question to.

Whoa nice answer :)