Live data from Hacker News

Ask HN: How many of you Apple developers still use Objective C?

news.ycombinator.com

51–60 of 160 posts

Re: Ask HN: How many of you Apple developers still use Objective C?

#51

I don't, but know many that do. I'll bet almost all AAA apps are still ObjC, and I know that Apple still uses it, in-house, for a lot of their stuff. I write my Apple stuff exclusively in Swift, and don't bridge to C. I have been doing that, since 2014. Before that, I wrote in ObjC. I still use UIKit/AppKit/WatchKit for my shipping apps, though. I do not believe that SwiftUI is ready yet, for the scope of my work (I…

SwiftUI definitely needs more time in the oven, but I’ve found it ok for bite-sized bits of UI where with UIKit boilerplate is as large or larger than the UI code and for screens that aren’t doing anything too interesting (e.g. a typical Settings.app style settings screen).

For now though, the bulk of my UIs will continue to be built with code-only (no storyboards/XIBs) UIKit.

Re: Ask HN: How many of you Apple developers still use Objective C?

#52

I am an iOS developer and I haven't used ObjC in over five years. There probably isn't any reason to start a new app or library with anything other than Swift. So it's just going to depend on the legacy code base.

> There probably isn't any reason to start a new app or library with anything other than Swift.

Unless you do anything for MacOS and care about MacOS. Most Swift UI apps I've seen feel foreign on MacOS in innumerable ways.

Re: Ask HN: How many of you Apple developers still use Objective C?

#53

Earlier quoted context omitted.

I'm not op and it's been many years since I tried but back in the early days of Swift interop with C worked great until it didn't and it was very difficult to figure out what was going on because the debugger might as well have not existed.

Not aimed at you particularly, but I've noticed more and more of the technical discussion on HN turn into "I don't really use it, but here's my many years old experience / non-user observation", which is mostly just confusing to people trying to leadn. You don't need to justify op with old anecdotes, people want to know what the issues are today, if any. At least that's what makes this website valuable for me.

Do you expect people to periodically repeat failed experiments just so they can provide you with up to date information? You are always free to ignore it.

In any case, this particular observation is timeless: language bridges always have trolls under them. Maybe your project can get away with using the bridge anyway, but maybe a highly critical API gets locked out because the bridge deals poorly with variadic arguments or object lifetimes or templates/generics or nested objects or latency/overhead assumptions or.... whatever, and the troll conks your schedule on its head. Try to minimize exposure and prioritize steps to de-risk the bridge.

Re: Ask HN: How many of you Apple developers still use Objective C?

#54
I used Obj-C professionally for about 2 years and Swift professionally for about 2 years. I have a slight preference for Swift. I've been doing mobile dev on iOS and Android since 2012 and there have been a lot of language changes and programming paradigm shifts. I think it's become more accessible for new devs. For me, I don't think the time and headache to learn the new ways really had a lot of benefit on the end product. Maybe in larger software shops it did.

Re: Ask HN: How many of you Apple developers still use Objective C?

#55
I’ve been an Apple platforms developer since 2002, though on and off in the past five years or so. So, 22 years of Objective-C and 10 of Swift.

I recently got into a client project that has some large swaths of Objective-C code. It’s a joy again, as the compiler is fast and the in-progress writing compile-ahead isn’t always shouting at me.

It’s really making me nostalgic. That said, I’ve been programming in C a lot lately, so there’s obviously a kinship there.

Re: Ask HN: How many of you Apple developers still use Objective C?

#56
The parts of Ardour (ardour.org) that have to interface with several Core* libraries are all written in Objective C(++) and will continue to be so until they can't be. That's not much code, but it's important code. Pretty much all UI stuff - the internal/lower-level stuff uses Apple libs that have C APIs.

And note: unbelievably, its 2024 and Apple is able to still fuck up drawing in very recent versions of macOS. How an organization with the history and resources that they have can get such basic stuff wrong is really beyond me.

https://developer.apple.com/forums/thread/738042

(this appears to be fixed as of 14.3)

Re: Ask HN: How many of you Apple developers still use Objective C?

#57
post #17

I use Objective-C exclusively (no Swift) in my App Store apps. I wrote a Swift app for a hobby/free project a few years ago and regretted it. They changed the language and deprecated some of my code, which isn't easily replaceable without a significant rewrite. The project now compiles only in Swift 4 and will die when Swift 4 support is removed from Xcode. I see no reason to use Swift. The compiler is slower and bug…

As a counter-anecdote from someone who also runs their own company, I began dabbling in Swift in 2014. I held off on full Swift adoption until after the big API renaming that happened with Swift 3, so language migrations haven’t been a big deal. The compiler is slower, but I can still do a clean build in 43 seconds.

Maybe I’ve had a good experience because I’m not working on a FAANG project with a million lines of code, but that’s all to say there are shades of grey, and you have to consider what you get in exchange for Swift’s compiler and evolution overhead.

Personally, I’ve found Swift helps avoid entire categories of bugs that crop up in ObjC, like accidental nil messaging. Generics have allowed me to avoid duplicate implementations. Now SwiftUI has allowed me to implement things in hours what would have taken me days in UIKit. I could go on for a while, but those are off the top of my head.

If you find yourself enjoying ObjC, by all means keep using it. Or C. Or Pascal. Or Lisp. There are tons of different ways to accomplish the same thing, but that doesn’t account for extra-hours and bugs it takes to get there.

Re: Ask HN: How many of you Apple developers still use Objective C?

#58
post #52

I am an iOS developer and I haven't used ObjC in over five years. There probably isn't any reason to start a new app or library with anything other than Swift. So it's just going to depend on the legacy code base.

> There probably isn't any reason to start a new app or library with anything other than Swift. Unless you do anything for MacOS and care about MacOS. Most Swift UI apps I've seen feel foreign on MacOS in innumerable ways.

Thanks for that perspective. I haven't done any MacOS development.

Re: Ask HN: How many of you Apple developers still use Objective C?

#59
I started a large solo project in late 2019 using Swift. I have no trouble compiling and linking the project today. I have been adding Swift code to an old Objective-C project without issues. There was an open source objc project I tried to modify recently, and was told that a feature was so deprecated that using it was no longer an option, forcing me to consider rewriting a large swatch of objc code; it just got so convoluted that I bailed.

Early Swift adapters got the arrows in the back. I was not an early adapter.

Re: Ask HN: How many of you Apple developers still use Objective C?

#60
post #14

Modern Objective-C with ARC is fairly painless, especially compared to the Objective-C of yore. And if you are doing macOS-specific work for a C/C++ codebase, it's still simpler to integrate than Swift is. Method swizzling is also an important tool for any aspiring macOS developer, unavailable/onerously painful in Swift. All in all, I don't think there's anything wrong with continuing to write new things in modern Ob…

> Method swizzling is also an important tool for any aspiring macOS developer, unavailable/onerously painful in Swift.

I use swizzling in Swift. Can't see why it's more painful than in Objective-C. It's also not something you do all the time. It's basically write once code for me.

Funny enough I mostly use it so swizzle UIViewController lifecycle methods and then just pass closures in instead of subclassing UIViewController. Yes, I don't subclass UIViewController and haven't for years and years. (I mostly don't subclass that much nowadays - take that Objective-C!)

Post reply on HN