Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon


5. September 2011

 

You may have noticed many times on my blog that I am not the biggest fan of C++.  I hands down believe that it is one of the dumbest languages a user could learn with.  A good majority of programmers should never be exposed to C++ and should be happy if fate affords them such a luxury.  I also think a lot of C++’s use in game programming is as much a matter of traction as any other logical reason.  So why the hell do I talk about it so much?

 

Well one of the reasons is because so many (new) developers give a lot of other new developers the horrid advice that they should start with C++ that you need to actively educate people why this is a mistake.  However, there is another reason for C++’s coverage… it is important and it’s importance is on the rise. Amazingly that rise in popularity has nothing to do with (specifically) game development!

 

You see, the revolution in mobile computing coupled with the rise in indy developers has created a perfect storm of sorts for C++ developers.  You see, of all the mobile platforms out there, they all support their own native language ( iOS = Objective C, Android = Java(ish), Palm == HTML5/Javascript while Windows Phone 7 == C#/Silverlight ) yet all of them support C++ ( although WP7 requires a special relationship with Microsoft for C++ access ), to say nothing of Symbian… mostly because it’s dying off. 

 

Therefore, if you want to write portable code that runs across most of the mobile phones on the market today, C++ is your go to language.  Operating in a resource constrained environment is exactly where C++’s strengths come into play.  Unfortunately you are going to end up doing some device specific code in whatever the native language is, but on all devices this amount of native code is getting smaller in size.  For the most part you can make 99% portable C++ code, something you can’t currently do for smartphones in Java, C# or ObjectiveC.

 

That said, if you are willing to spend money, you can use C# across platforms in the form of Unity or Monotouch/Monodroid but that requires additional expense.  Besides, I recently took a look at Monodroid and I simply cannot imagine how anybody is using that platform for production code, at least on Windows the developer experience was frankly atrocious.  If I was doing a cross platform 3D game ( that I expected would make at least 400$ ) I would be ( and am ) using Unity, but I can understand why you would choose otherwise, especially if you were working on a 2D project.

 

If you are a new developer, I still recommend you stay the hell away from C++.  I just wanted to make it clear C++ has it’s uses and in my opinion is only going to get more popular, a comment I would have never expected to have made just a few years ago! As I have said many times C++ is just another programming tool and sometimes that tool is the most appropriate one for the job.

 

Given it’s justified rise in popularity among indy developers, combined with the fact that beginning programmers are going to ignore my advice and start with C++ anyways, I am going to introduce a bit more C++ specific content on this site.  The C++ of today is much different than the C++ of 1983, yet unfortunately a great volume of the information on the internet doesn’t reflect this fact.  I hope to address that to the best of my (meager) ability.

Programming ,

blog comments powered by Disqus

Month List

Popular Comments