4 ms·
Objective-C++ is one of those things that sounds like an abomination when you first hear about it, but when you try it, it's surprisingly straightforward and us
by iainmerrick 3y ago
Objective-C++ is one of those things that sounds like an abomination when you first hear about it, but when you try it, it's surprisingly straightforward and useful.
Obj-C and C++ are really very different, so it makes sense to use each one for what it's best at; and the syntax of each is so different that it clashes much less than you'd expect.
- drawkbox 3y agoWhen I first learned about it in 2008ish I was blown away, really just using g++ to compile and you are set. Very interoperable and more than expected, C/C++/Objective-C++ all work well together, maybe even better than layers on top today in mobile/web. It isn't recommended to use all these unless there is a reason, but for integration points it works great. Using C libs in C++. Using C++ libs/systems in Objective-C++. Accessing Objective-C from C++ etc. The game engine is in C++ so to use it on iOS we needed to have an integration point for the system level Objective-C libraries to the C++ game engine (same with Android NDK integration in a way). Another game engine from around the time Oolong Engine [1] also used this and was used for an early Quake to iOS port. Like our custom engine Oolong used PowerVR/PVRTexTool to simulate PVRTC/PVRTC2 textures. This setup made it so you could just develop your whole desktop/console/mobile game on PC then it would run on iOS with the Objective-C++ integration points. That was huge for game studios that only had PCs pretty much at the time. [1] https://code.google.com/archive/p/oolongengine/ https://code.google.com/archive/p/oolongengine/
- pjmlp 3y agoIt goes all the way back to NeXT days actually.
- gumby 3y agoI ran into Steve Naroff a couple of years ago and he said, "it's still amazing that we got Objective-C++ to work" ("we" being his team at NeXT and ours at Cygnus). I'm impressed Jobs went for it. It's pretty great for the reasons you said.