Advertisement

Anyone here develop for Mac?

Started by October 08, 2011 03:25 AM
10 comments, last by Serapth 13 years ago
Well i mix C++ and Obj C all the time without bigger problems.
The only thing you have to remember is that u cannot call Obj C Type Functions with C++ classes and the other way around. But besides that it works wonderful. For most Obj C Types u have Methods to convert to C++, like for Example the NSString method asCString .. which returns the NSString as a char*..

For games, it works best for me to code entirely in C++ because it is my native language and i want to have the game portable. The Interaction with the iPhone Framework is of course Obj C but that are 2 classes which I haven't touch since the first two days of developing :-)

In my work, when i code Apps, i use 95% of all time Obj C.. and I love it for that. The [ ] syntax was a bit weird in the beginning but now i don't mind anymore. I switch between C and Obj C without thinking about it.

Whats better/faster/etc.. ? It doesn't matter, its about you. Unlike Java, Obj C doesn't get interpreted, it gets compiled like C/C++..

Obj C feels sometimes easier to handle like C, as you have more build in functions like MutableArrays etc which don't exist in C. You also don't have to think about chars etc, because the NSString class is doing that for you. Its actually C++ with the STL but a bit more complete..

well, my two cents..

I open sourced my C++/iOS OpenGL 2D RPG engine :-)



See my blog: (Tutorials and GameDev)


[size=2]http://howtomakeitin....wordpress.com/


Whats better/faster/etc.. ? It doesn't matter, its about you. Unlike Java, Obj C doesn't get interpreted, it gets compiled like C/C++..


Be careful here, you are wrong but it may simply be semantic at this point.

Java is compiled, just like C++ and Objective C. Also, as Java and C# ( and to a degree C++ ) all have a run-time that is called upon heavily to support newer language features ( like dynamics and reflection ) just like Objective C. The only difference is Java defaults to byte code that is run within a virtual machine, although it can be compiled to native code.

ObjectiveC has performance issues of it's own. As it doesn't actually do direct function calls but instead dispatches messages, the initial routing of the message through the run-time can have performance implications.


The line between virtual and native code is blurring more and more, as performance optimizations from the one camp and the need for additional features from the other camp are pushing all languages towards a pretty typical hybrid approach.

This topic is closed to new replies.

Advertisement