4 ms·
Ask HN: Why torture yourself with Objective-C?
A bit confused here. I've deployed multiple iPhone applications with 0 native functionality only using HTML/CSS/Javascript. I've deployed to over 10 phones and everything works perfectly.
What is the point of using OBJ-C? It seems much harder to learn and use efficiently. I have a few friends who refuse to use anything but obj-c for their apps and as a result, it's taking them forever to deploy with much more headaches. Meanwhile, I'm deploying to multiple platforms with everything working flawlessly, even accessing native phone features.
Genuinely curious, not favoring one over the other as I've never ever laid hands on objc, though I tried once, I gave up.
- wittedhaddock 13y agoI really appreciate this question. Thank you for asking the seemingly obvious - yet, not at all.
- xauronx 13y agoIt's actually kind of obvious. If there weren't benefits, people wouldn't use it, and there are some pretty obvious benefits. Why use a directly compiled language instead of a scripting language put through two(?) layers of translation? Why use a language that let's you directly access all features of the platform? etc Honestly, there are few apps that provide anywhere near the user experience that a native app does (one of those being facebook) and even they opted to switch to native. I've written a graphics intensive phonegap app and... needless to say, that was enough incentive to learn objective-c and I'll never look back. Objective-c is actually an awesome language, it's just tough to learn for most developers coming from a standard dot notation language.
- Randgalt 13y agoNote that Facebook went from an HTML 5 iOS app to a native app. See this post: https://www.facebook.com/notes/facebook-engineering/under-the-hood-rebuilding-facebook-for-ios/10151036091753920 https://www.facebook.com/notes/facebook-engineering/under-th...
- sahrizv 13y agoThe most compelling reason to use Objective-C for iOS development is to make use of the vast array of device-native APIs provided by Apple, most of which are not available to webapps as of now. While you can use PhoneGap/Cordova to wrap your webapp in a native container, and access many native APIs, the process is convulated to say the least. Besides, with Apple releasing new API's(1500 new APIs for iOS 7 [1]) with every upgrade, the likes of PhoneGap cant really keep up with natively available functionality. Performance is another big reason which comes to my mind. [1] http://www.macrumors.com/2013/06/12/upcoming-ios-7-apis-gaming-improvements-multitasking-support-airdrop-and-more/ http://www.macrumors.com/2013/06/12/upcoming-ios-7-apis-gami...
- biafra 13y agoNot everybody thinks Objective-C is torture. Some people might even say that HTML/CSS/Javascript is more torturous. And I am sure that there are people who are more productive in Objective-C than you are in HTML/CSS/Javascript on the iOS platform. Especially when they are implmenting features that are impossible to implement without using Objective-C.
- mertdumenci 13y agoI personally don't think that HTML and CSS are a good fit for building complicated, highly performant mobile layouts in the first place. Additionally, despite my love for JavaScript, JavaScript is not as fast as native code on mobile phones. You can really feel the difference between a fully native app and a web based app on iOS. (well, unless you can build something as good as Fastbook[1]) But there are definitely things that you can do with two lines of HTML & CSS (like advanced text layouts) that require much, much more code in Objective-C. Someday it will become a personal choice and hopefully won't differ at all to the user, but I don't think we're there just yet. [1] How on earth is this this good? http://fb.html5isready.com/ http://fb.html5isready.com/
- joeblau 13y agoSometimes you can't do what you need to do in HTML/CSS/JavaScript. I was trying to make an application that could read straight off of a TCP socket to stream images from Twitter, Facebook, Instagram, and Google+ into a mobile app in real-time. With the amount of data I was pushing though, the JavaScript couldn't keep up and was crashing so I had to go native. I think a lot of light-weight apps can be written in JavaScript, but sometimes it's just not possible.
- coryl 13y agoPerformance reasons, native API / framework availability. A native developer can achieve anything the JS dev can, but vice versa does not apply. OOP is a pain to learn, but once you learn it, you have access to all OOP languages. I like Obj-C, and Apple's API are great.
- pandaexpress 13y agoBecause I don't see it as torture. I find Objective-C to be a perfectly pleasant tool, and it allows me to do things that would be A) implausible or B) impossible were I to make webapps (or PhoneGap apps) instead.
- mayoff 13y agoBecause Web technology just doesn't have the performance to do what I want to do. Because every time I use a language that lacks Smalltalk-style keyword messages, I find myself missing them.
- jozefg28 13y ago> Though I tried it once, I gave up Perhaps experience is the deciding factor. I thought the same thing about Common Lisp and Haskell until I took the [long] time to learn them. A steep learning curve doesn't mean the tool sucks.
- pbreit 13y agoI have never seen a non-native app that works as well as a native one does or would. It's a simple trade-off: easier development vs better user experience.