Anyone one had any experience writing games in C++ or C for iOS? this article seems to say it's much better performance wise to write them in C. Thoughts? http://www.vellios.com/2010/08/22/why-game-devs-dont-use-objective-c/
ObjC is a great modern language and easier to do things, but for games, I use C/C++ because: 1) performance wise and 2) cross platform.
Use C++ for everything you can, and ObjectiveC for the rest. Avoiding ObjC will allow you to make your game cross-platform.
Thanks for the article. The comment saying that what is slowing down the game are calls to NSMutableArray is very interesting... I code in Obj. C because I just love the language and knowing C it was easy to learn, but I'll consider using C for parts of the code to gain in performance... wrapping things in objects is very convenient, but if performance is an issue it's clear it's better not to do it...
Some general notes 1. ObjC dynamic function dispatch is about x2 slower then C++ virtual functions 2. ObjC compiler does not inline code, C++ functions, Templates can be etc. in some code this is a massive speed win vs Objc. 3. All this given... ObjC is Perfectly fast enough to make most apps and many games... heck ObjC ran fine on old 68000 CPU NEXT boxes So don't worry to much... also... you may find in tight loops with a lot of function calls it would be much faster to code those functions in C or C++ and call that from ObjC. 4. Anyhow its perfectly fine to mix and match ObjC, C , C++ , Lua etc as needed.
Objective-C is fine but it has terribly slow libraries. As long as you avoid the libraries then the only issue is with really tight loops, where you want to juice every last bit of performance out, use C. Of course if you don't use the obj-c libraries your mostly coding like you would with C except with classes and properties. C/C++ is really the way to go. Obj-C locks you into apple's platforms, making it more difficult to release ports and there's many gamedev libraries for C/C++ that you will probably want to use anyway.
For a professional developer, C++ is the way to go, cause once you know C++, (with the exception of assembly) you pretty much know every other programming language. That being said, as C++ programmer for 15+ years I prefer using something like Corona SDK which is written in Lua and gets you a lot farther in making apps in less time then developing natively. I just want to get my ideas on the screen and not have to deal with doing a game engine. Less control and some limitations sure, but it's made programming far more enjoyable.
Correct, you won't know Lisp or Scheme and also you won't know Logic programming like Prolog. I learned those in school. But for the purpose of 99%(magic number out of my head) of the software out there, understanding of procedural(imperative) programming is all you need. Curious are there any apps written in lisp on the iPhone? lol!