Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Android now offers the possibility to create entire apps in C++ using the NDK. On iOS you can also use C++.


Does the new NDK actually provide access to the UI API's?


I did not know that :) So if you can use C++ on iOS, why the hell are people using the horror that is Objective-C?


On iOS C++ is generally only used when you don't need to make much use of the Cocoa Touch APIs. If you do, you will be using the hybrid 'Objective-C++' language, and you will still need to use some Objective-C.

See this Stackoverflow answer: http://stackoverflow.com/questions/3804219/what-is-the-diffe...

Basically, it's probably easier and less messy to just learn Obj-C.


Because Objective-C is far from being an horror language, but perhaps your impression (and so mine) is conditioned by your past experience with your languages of choice.


I'm probably being unfair, I've never actually done any development in Objective-C (I have in C++), so I'm going on how it "looks" from the code I've seen, I just find it very unreadable. But in fairness I haven't tried to get into it, and I'm probably biased toward the C#/Java style syntax...


Cocoa is an incredible API. Much more pleasant to work with than Qt, hands down.

The runtime method dispatch of Objective-C (protocols!) makes it possible. Basically Objective-C gives you what Qt had to kludge in with qmake/moc. And it's still pretty fast!

When I see how little code I have to write to do something basic in Cocoa/Obj-C, and how well it turns out, any problems I have with syntax go out with the window.


Your initial reaction to Obj-C is not at all uncommon amongst developers used to C++/Java/C#. My impression is that most of them quite like it once they get past the novelty.


As a counterpoint I've written ObjC code for over 5 years for Mac OS X and iOS, and I'm not a fan. Sure it's better than C++, but that should be in the dictionary under "damning with faint praise". Header files, primitive types, and reliance on raw pointers should have gone out 10 years ago. The kicker was when I switched to Android development last year; when a language makes Java look comparatively elegant and concise, that's not a good sign.


I neglected to give more than a cursory glance at Obj-C back when the iPhone 3G and app store first came out. I hugely regret it now, but I was doing C++ at the time and thought it was the cat's pajamas.

If you can think abstractly and use/like languages like Ruby and Lisp (and their reflection/metaprogramming features), I think you'll be surprised by the amount of stuff you can do at runtime in native code. I started doing Obj-C a week ago and am about to submit my first free, 90% custom-drawn control app to Apple for approval.

Yes, the syntax is initially unappealing, but you get over it after about a day. On top of that, Xcode + Interface Builder is the best GUI dev environment I've used yet.


As ugly and annoying as Objective-C is, I find it's still an order of magnitude better than C++.


Back when Java was my favorite language, I was once challenged to spend an hour looking at Objective-C and see if I didn't grok it in that time period, and then a week working with Cocoa-- and was promised that I'd love it if I did.

They were right.

I still believe Objective-C, paired with Cocoa is far and away the best programming language and environment out there. I've worked on the internals of windows, lots of C++, lots of Java (used to be my favorite), done .net, done a bunch of scripting languages, python, perl, lingo and actionscript, and lisp and erlang.

On the server it should be erlang (for serious code, for less serious use your favorite script)... and on desktop and mobile, Objective-C and Cocoa are really quite spectacular.


This is my experience too. I resisted learning Objective-C very much, and tried to avoid learning it via MacRuby. But once I actually resigned myself to really learning Objective-C, I really enjoyed it.

Like Ruby/Python it has a specific style that gives you a different perspective than other languages. I now find myself using ObjC style-isms in other languages.


I think people find a language they like- maybe their first language, or one of the first couple- and then it is really hard to be interested in everything else. If you can't read it right off the bat, it "sucks".

This is how I felt about erlang. But the importance of concurrency was so high to me that I forced myself to learn the language, and now I love it.

A couple times learning a new language after being annoyed that it isn't like the language you already know, and I think people might recognize that every language has a reason for being....


because ... well ... you're uninformed and obj-c is not a horror?


See my reply within the thread above




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: