Objective C and C++ for Game Development

blissfreak
  • Objective C and C++ for Game Development blissfreak

    I'm trying to figure out which language I should begin learning. I've only been programming for about 6 months, with languages like PHP, Java, and C#. I want to learn how to dev games, and while I know in most cases the answer to this would be through C++ (at least, I would think), though I'm still curious about what Objective C can offer in the sense of long term benefit.

    It seems like there's a chance that Objective-C may actually become more popular than C++ in a few years, and for all I know, it may become the de facto standard development language for games. Still, despite all of this, I really don't know anything, and this is all speculation.

    Both languages seem very interesting, and obviously can pull a lot of out of themselves.

    What do you think?

    Note: despite what some might say, I really don't want to end up using prebuilt engines, and would rather just learn how to make my own. I'm well aware that it takes a lot more time, but I'm quite ok with that.

  • From my perspective, Objective-C is mainly used to develop for OS X and iOS. And even there, a lot of people tend to use C++ because of portability. Looking at a language comparison over at Ohloh, I can't really see much of a trend that Objective-C will replace C++ in the near future.

    Also have a look at this question (Objective-C or C++ for iOS?).

    I personally like Objective-C, but C++ is far more widespread and very portable. You'll also find tons of resources and libraries about/for C++. If you want to develop specifically for iOS or Mac OS X, you could consider Objective-C, but for all other cases I strongly reccomend C++.

  • I want to learn how to dev games, and while I know in most cases the answer to this would be through C++ (at least, I would think),

    Actually, while C++ is an important language for anyone aspiring to enter the field professional, it is by no means the language you have to learn to make games and, in fact, makes for a rather poor first language (primarily due to its complexity, the wealth of incorrect/poor information on the language out there, and most important its cultural penchant for assuming the programmer is right, which is bad for a neophyte).

    It seems like there's a chance that Objective-C may actually become more popular than C++ in a few years, and for all I know, it may become the de facto standard development language for games. Still, despite all of this, I really don't know anything, and this is all speculation.

    Something will replace C++ eventually, as C++ has by and large supplanted C, which has by and large replaced machine-specific assembly. That said, it's very hard to gauge what will replace C++ and mostly a thought experiment -- for practical concerns, it doesn't matter what language we all eventually move on to.

    It's fair to surmise that the popularity of the iOS platform might help usher in a new era for Objective C, one where it's not considered some unusual warty distant cousin of C++. But in practice one can write iOS games with a bare minimum of Objective C bootstrap code (doing the rest in C++), and Objective C itself doesn't offer enough modern advances to make it otherwise more attractive, so I doubt it will replace C++ ever.

    Note: despite what some might say, I really don't want to end up using prebuilt engines, and would rather just learn how to make my own. I'm well aware that it takes a lot more time, but I'm quite ok with that.

    Do you realize that using pre-built technologies is (1) essentially inevitable (you'll be using a pre-built runtime on a pre-built OS for example) and (2) orthogonal to the issue of which language you use?

    It's fine to build things yourself for learning purposes, but don't let "not invented here" syndrome get you in its claws. Once it has you, it's hard to get out, and it's very easy for a new programmer to get snatched up. Resist the temptation, you will be a better developer for it in the long run.

    So all that ancillary stuff being said, to answer your real question:

    It doesn't matter which language you pick. My personal recommendation for people who want to get into game development and don't already know any programming languages is C# or Python. If you already know a language, use that language (it sounds like this is where you fit; if you know some C# already, I'd say continue using that). If you really can't decide, flip a coin. Between C++ and Objective C I'd say go with C++, since I think the available tools are more mature (especially on the Windows platform -- Xcode is decent if you are on a Mac, but it's no Visual Studio).

    A good programmer will know many languages and, similarly, the more languages a programmer knows the easier it is for her to pick up more. So you should never be focused on trying to predict the motion of the industry so as to study the "right" language. Instead, pick something, learn it, make some games, and move on to new languages as the time comes. You will never be wasting your time doing so.

  • Here are a couple of other posts that are related to your question:

    Is C++ "still" preferred in game development?

    What are the most commonly used programming languages?

    Am I hurting myself by not knowing C++ for game design?

    Also, this isn't terribly relevant, but I thought it was interesting: Google's language performance comparison

  • Where raw performance is concerned, C++ as a language has an advantage over Objective-C as it favors compile-time over runtime (static dispatch, templates, C++ 0x constexpr). It is doubtful that Objective-C will ever replace C++ as the lingua france of cutting-edge game development.

    However, more dynamic languages like Objective-C are generally superior where ease of implementation is concerned. But no one forces you to implement your game in a single language, and it's common to embed the runtime for an even higher-level language like Lua into C++ game engines.

    This isn't to say that Objective-C is a bad language for game development - its rather unique combination of raw performance and dynamism definitely fits the problem domain, and thanks to Apple it has recently gained some popularity - but it's not a silver bullet: There are better choices for the highest and the low end of the performance spectrum.

Tags
c++ objective-c
Related questions and answers
  • animation I would end up storing a lot of data that I don't really need, even if I'm indexing node and frame data when saving and then store the hierarchy with the indices to the actual data. I don't know if my speculations are ok, as I don't have much experience with 3d animations yet. I want to make a well decision as any option I choose would require a lot of work to get it to render and I don't want to find out in the end that I have to rewrite everything again, as a lot of other objects will be working with these data. Sorry if it's a too subjective matter, but I need some insight. I'm

  • want to have fun, and c# is fun ;) SDL. Quite frankly, I'd still need to port to all those different SDL implementations. And I don't like OpenGL style programming, it's just plain ugly. And it needs... to use Flash, but I don't know if it scales well enough. I'm not a scripter, I want some real APIs that I can work with inside a proper IDE. Just for information, I looked at several alternatives, I'm... don't need 3D, and it is quite ...a lot of work to learn. I also don't like that it is so expensive to use for different platforms and that I can only code for it through scripting. You have to buy each

  • to start with.I like to create big games but after starting i feel the game is too heavy to handle. Can any one list out the basic needs of a Game Play programmer? I don't mind using any platform (Flash,c++,objective-c) but i need to know what are the game logic's i need to know before i start a big game. ... Possible Duplicate: What are good games to “earn your wings” with? Hai, I'm new to the genre "Creating Games".Previously i had done only porting.I need some suggestion's

  • in the world. I'm OK at C++ but its one language I would really like to explore and make my primary language. (assuming there are jobs for grads in this area) This project will most likely define the career... of this then why would I be here asking this question? The reason is as shocked as I am about this. I don't like to lose. I have my own queries on how appealing this project would be to someone looking... i seek out to make this not just a passable project but one that'll be demo-able and I can stand proud beside. What advice can you give to someone like me that you wish someone had told you

  • I was recently listen to a talk that Jonathan Blow gave, you can find it here. In the talk, he was talking about what data structures he (and he seemed to imply many others) use, and why. Which... that. All this seems well and good, except I have one question, why not linked lists rather than arrays? Sure, if you had to make your own linked list class, I would be on board, but in c++ anyway, assuming... around and found this, which claimed that a lot of older developers didn't want to use STL because it wasn't mature enough. Also, older games AFAIK, used C rather than C++, which also doesn't have STL

  • to worry about this since it isn't an issue there. Moving to C++, this has become a fairly major problem and made me think I may have designed things incorrectly. I can't really imagine how to decouple... question about it is, is this a worthwhile approach at all? If it's a bad design I want to know now before I invest too much more time making all the screens I'm going to need. How do you build up... related to the graphics library I'm using, but is more of a conceptual thing. In C#, I coupled graphics in with alot of my classes which i know is a terrible idea. Wanting to do it decoupled

  • 1st Question is I want to write a board game for iOS and Android so I'm coming up with CoronaSDK and AirPlay. Since I have a mac, development platform is not an issue but the problem is which one should I choose. I'm fluent with PHP and web languages and familiar with C but it's a new language for Lua. I know a lot of people prefer Corona but why not Airplay? It even provides more devices and able to write in C/C++. 2nd Question is I want a SDK with shortest development time and easier coding. I don't need complex 3D or animation engine since the game is a board game like chess or monopoly

  • . state_->handleEvent(event, this); } That means that I don't really ever need more than one instance of a particular entity state; doing something like entity.setState(new StandState) is therefore highly wasteful. Then again, making each entity state a singleton hardly seems appropriate. What do you suggest I do? (The same can be said about game states, so whatever the solution...This is the first time I'm trying to make a 2D game, so I'm having quite a few difficulties in getting things right. Right now I'm trying to figure out exactly how the entity state machine should

  • though I know it costs more in terms of overhead. On the service side, I'd like to use an authentication framework such as Apache Shiro to authenticate users against a MySQL database. I'm not sure... that alone make the overhead worth it? If not, what should I do here? I want to make sure all of the requests from the client are authenticated but I also don't want to have to jump through hoops to make... leverage it. My client is going to be written in C++ and I can use whatever language makes it easiest (I'm leaning towards Java) to make it happen on the server side. I plan on adding support for users