• Advertisement
Sign in to follow this  

c++ in obj-c, reasons not to?

This topic is 2614 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Just curious, is there any reason NOT to make only .mm files when coding in obj-c? I'm not really sure why c++ is optional other than to support older compilers or something...

Share this post


Link to post
Share on other sites
Advertisement
Quote:
reasons not to?
Preserving one's sanity?

Objective-C++ is a truly unholy combination, mostly there to keep certain companies possessed of large C++ codebases happy (especially with the deprecation of Carbon). There are plenty of C++ features that just don't work in Objective-C++, and plenty of difficulties in interoperating between the two languages.

While it is vaguely useful in order to bolt a Cocoa/Touch UI onto an existing piece of C++ software, I would advise steering clear for the most part.

Share this post


Link to post
Share on other sites
Interesting. Being new to Obj-c, I still haven't even used c++ code in it yet. I suppose if I tried I'd run into the issues you mentioned. I didn't realize they didn't mesh well.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement