Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ghostlines

macrumors regular
Original poster
Feb 3, 2010
155
14
Amsterdam
Hi, I was browsing through some developer docs from apple, and it seems new API's like healthkit are still written in Objective-C.

I thought all new stuff would be written in Swift. So is the idea that you constantly have to map stuff from Swift to Objective-C, and thus still have to partially know the Objective-C language?
 
Because every almost every single app for iOS is not written in Swift? You can't expect every single app to suddenly be written for Swift just to take advantage of these features. Besides, as it currently stands, Swift is still a beta language where source compatibility is not guaranteed.
 
Thanks for the feedback. Makes sense because Swift is brand-new and still beta. I was hoping I could run away from still having to learn Objective-C as a new developer. But I guess we have a long way to go before that's the case. Guess you still gotta learn both.
 
Thanks for the feedback. Makes sense because Swift is brand-new and still beta. I was hoping I could run away from still having to learn Objective-C as a new developer. But I guess we have a long way to go before that's the case. Guess you still gotta learn both.

Obj-C is needlessly demonized. Now that, with ARC, you don't need to manually manage the life cycle via retain/release of simple objects (not, say, simple C arrays on the heap), it has become considerably easier to learn.
 
Obj-C is needlessly demonized. Now that, with ARC, you don't need to manually manage the life cycle via retain/release of simple objects (not, say, simple C arrays on the heap), it has become considerably easier to learn.

I don't needlessly demonize it. Over the past year as I've learned languages like Python and Racket, I've come to realize what a pile of crap Obj-C is. There's a thread about "Objective C 3.0" somewhere here - I laid out there a list of my biggest complaints about Obj-C.
 
I don't needlessly demonize it. Over the past year as I've learned languages like Python and Racket, I've come to realize what a pile of crap Obj-C is. There's a thread about "Objective C 3.0" somewhere here - I laid out there a list of my biggest complaints about Obj-C.

I've played a little with Objective-C and program normally with Python. I like Swift's type inference and the code looks cleaner. I've seen that they're some Apple docs explaining how to interact with Objective-C API's via Swift.

Maybe Apple hasn't gotten around to writing all the docs in Swift yet.
 
I've played a little with Objective-C and program normally with Python. I like Swift's type inference and the code looks cleaner. I've seen that they're some Apple docs explaining how to interact with Objective-C API's via Swift.

Maybe Apple hasn't gotten around to writing all the docs in Swift yet.

Check out the doc online in the developer portal instead of Xcode doc browser.
There is a jump bar at the top of the doc's in the browser that lets you switch between Swift and Obj-C syntax for each of the classes.
 
I think it's important to get some programmers eyes on it so Apple can find and fix the issues that might hurt adoption of the new language. Plus, they probably didn't make this decision lightly. I wonder if this new Backend as a service stuff is written in SWIFT.
 
Swift is still in beta. Apple wants developers to use all these new APIs in tested production code and real apps, not just in flaky beta testing playgrounds.

But well after the beta is over (a year or two from now), I wouldn't be surprised to see Swift only or Swift optimized APIs and documentation.
 
I don't get all this Playground dominance in all talk on Swift. Yes Playgrounds are very, very buggy currently. But normal Swift usage is outside Playground in normal Xcode-targets...
 
It will take Years Before Swift Takes over Objective C.

I would compare Swift to when Microsoft switch over to C#Sharp from C++.

C#Sharp Tooks Years before it become popular, plus a lot of developers still code in C++. A lot of Software Code Base is still in C++.
 
C# was announced in 2000, reached 1.0 in 2002, but didn't rise above 3% percent popularity in usage until 2004, about four years after the announcement. (See TIOBE for details).

My guess is that Swift usage will be above 3% usage before mid 2016, e.g. a much faster rise than C#.

But Apple isn't even guaranteeing that current Swift code will be source code compatible with what comes out of beta. So you can't even write Swift code that won't break a few releases down the road. Wait a couple quarters.
 
Obj-C is needlessly demonized. Now that, with ARC, you don't need to manually manage the life cycle via retain/release of simple objects (not, say, simple C arrays on the heap), it has become considerably easier to learn.

Yeah, it's not too bad. I'm about halfway through the Big Nerd ranch book on it and so far it's been mostly fine. Object access syntax without dot notation is a little dodgy and some of the ways of doing things is a little odd for me who's coming from developing in other, wordier languages.

But, for some reason.... I'm liking Objective C overall. :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.