News for hackers. Stuff that matters.
Re:I loved C. But it always fell short for me. Objective-C f... by cageface on Monday November 07, 2011 @04:16AM (#3205549)
Objective-C is a nice UI glue language but I wouldn't want to write anything of any algorithmic complexity in it. The data structures are just way too awkward and manual boxing/unboxing of primitives puts it way over the top.

I write my iOS app UIs in Obj-C but the brains are in a C++ core. The new C++11 support in LLVM 3.0 has tipped the balance that much further.

Re:I loved C. But it always fell short for me. Objective-C f... by natesm on Monday November 07, 2011 @04:51AM (#3205650)
> manual boxing/unboxing of primitives puts it way over the top

FWIW: https://github.com/NateStedman/FunSize/blob/master/FunSize/N...

Re:I loved C. But it always fell short for me. Objective-C f... by blub on Monday November 07, 2011 @04:25AM (#3205563)
If you think Obj-C is nice, try Qt's QML - it's a declarative language with JSON-like syntax that also allows you to embed JS and interact with C++.

Probably one of the easiest and more powerful ways to create an UI, but not as mature as other consacrated frameworks and not available on iOS anyway.

By the way, how do you handle unicode in the C++ core?

Re:I loved C. But it always fell short for me. Objective-C f... by cageface on Monday November 07, 2011 @04:32AM (#3205594)
I'm kind of stuck with Obj-C on iOS but I can totally believe you could build an abstraction layer like the one you describe over vanilla C++ that would give you most of the benefits of Obj-C. Clang's Obj-C++ support makes it pretty painless to mix Obj-C and C++ as long as you clearly delineate responsibilities.

So far I haven't had to do any serious string handling in my C++ engines (mostly audio apps). The new unicode stuff in C++11 ought to make this manageable but I haven't actually tried it yet.