

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer

I'm a computer engineering student and taking my second programming class. I'm learning C++ using "C++ Primer Plus" 5th edition by Prata. I want to develop for iOS. I understand the main language for Xcode is Objective-C. Am I hurting myself by learning C++ before any other language (notably before my desired lang Objective-C)? There's got to be a reason the university requires C++ to learn as a basis language.

Please offer any helpful guidance or how I should go about this. Thanks//

share|improve this question
No you're not hurting yourself at all. C++ is just a very widely used language, and that would be one reason why your university uses it. All languages are actually very similar, and when you understand how to produce efficient algorithms to solve specific problems, as well as how different data structures work, you can easily pick up any other language. – Mick Apr 11 '12 at 3:46
Well that is settling to know. Thank you :-) – nodebase Apr 11 '12 at 3:46
Maybe I shouldn't do that, but I updated my answer multiple times. I will leave it at that from now on. – Coyote Apr 11 '12 at 23:43
"There's got to be a reason the university requires C++ to learn as a basis language." Yes, but the reason for that is only answerable by the university department heads (or whoever makes the decisions). As far as I know, most universities are shying away form C++ as it's a very large language and complicated language and preferring to use things like python and java. – Tetrad Apr 12 '12 at 15:41
Also this question is pretty subjective and probably a bit misguided. I don't know how "is learning <x> bad" could ever be "yes" other than the time/reward ratio you personally get out of it. – Tetrad Apr 12 '12 at 15:43
up vote 8 down vote accepted

Am I hurting myself by learning C++ before...

No, C++ is a good way to learn about all the basics of programming, including Object Oriented programming, and memory management which might be handled for you in other languages.

There's got to be a reason the university requires C++

It is an industry standard across the world. It is quite portable as there are compilers and implementations for most platforms.

notably before my desired lang Objective-C ?

Objective-C is contemporary of C++, they appeared around the same time and take different approaches when it comes to their Object Oriented paradigms. But they are both supersets of C and as such you can mix both.

My experience

The fact is most games I worked on for mobile are C++ games with some C, Objective-C or Java providing native functions to C++ in the game code.

I actually worked on only one Objective-C game. The dev time was shorter, but the game is now stuck as an iPhone only product.

Word: Rest assured that C++ is definitely the best choice of language you could currently start with. It's not the simplest, there are fewer standard libraries, memory management without smart pointers seems harder... But in the end, once you understand C++, you can approach other languages with a better understanding of what they provide, do and what they hide from you.

Another word: As a programmer you should not stop at one language. You will have multiple opportunities to learn other languages and different approaches... Don't shy away from acquiring these little skills and seemingly uninteresting languages. They make all the difference when you are faced with new (and increasingly challenging) problems, like building leader board servers, web games, massively distributed databases and games...

Note: If you learn both C++ and Objective-C at the same time, the experience shouldn't be too confusing as they are not so similar and the first approach of iOS dev quickly goes into the high level UI APIs while C++ digs into more low level things.

You might end-up favoring Objective-C as it comes with great APIs on Mac/iOS, it has a solid (for lack of a better word) memory management system, garbage collection, etc. But remember that in games development C++ remains the most used language

C++ deserves a place in every programmer's heart, mainly now there is much more to modern C++ than C with classes.

share|improve this answer
Nice stuff about C++ :) – noob Apr 11 '12 at 12:09
Actually, C++ and Objective-C are both (loosely speaking) supersets of C. This is why Objective-C++ works - both languages have the C-like subset of functionality in common and (fortunately) have their additional parts largely orthogonal to one another. – Mac Apr 11 '12 at 22:55
@Mac Indeed... Fixed. – Coyote Apr 11 '12 at 23:05

You're not hurting yourself because you're doing what is required by your school. Learning to program is only partially about learning the syntax of a specific language (and it's a small part!). Right now you're learning to think logically and like a programmer. Don't worry about learning things you don't need, because it's all useful in some way.

share|improve this answer

C++ is where almost every new programmer learn about object-oriented designs first (at least in my area, it's true). So you are not hurting yourself. Also you can develop iOS (even Android )apps in C++.
If you are thinking to go into game-development, C++ is the de-facto language here, supported by most of the game-engines. So learning C++ is always a win-win situation whichever path you choose.

share|improve this answer

Objective-C is but one of many languages you can learn to use for iOS programming. Not only are you completely free to write C and C++ code on iOS (with some caveats), Apple also supports a language called Objective-C++, which is exactly what it sounds like.

While you do not need to use Objective-C to program your core application, the Apple APIs are all exposed in Objective-C. However, this matters a lot less than you might think. Well designed, well architected programs do not generally rely a lot on platform APIs (some exceptions apply). If you do your job right as a programmer then porting your application to other platforms should require relatively little of your application's code to be rewritten. This is done with the arts of abstraction and encapsulation. As an example, one engine I have now has less than a dozen Objective-C files but close to a thousand C++ files.

Regarding the choice of C++ as a first language, you should consider yourself very lucky. Most schools start with much worse first languages. You are unlikely to find any school that teaches Objective-C outside of a course or two on iOS development, and there's a reason for that. Especially when it comes to developing large, complex applications like games, Objective-C has a lot of weaknesses (all the weaknesses of C combined with all the weakness of a dynamic language, in fact) compared to C++, and you're going to be far better off having a solid grasp of all the tools that C++ offers. Learning Objective-C on your own will be very easy after you get a decent grip on C++.

share|improve this answer

Also (in addition to the other answers posted), objective C is a layer on top of C and most of the code you will be writing is c and c++.

share|improve this answer

Your Answer


