Live data from Hacker News

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

news.ycombinator.com

61–70 of 160 posts

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

#61
I work on an app that's over a decade old, and there's a fair mix of Objective C and Swift.

While we tend to add less new Obj C, we don't go out of our way to replace old Obj C with new Swift if the old code is working. If it makes sense to replace some of the Obj C, we do, and this happens on a case by case basis.

At the end of the day code is just a tool, and if it's doing its job it's worth a sober look at whether the opportunity cost to replace it is really worth it beyond some perceived notion of newer == better.

Some things that I really like about Obj C more than Swift:

easier to explicitly manage memory

clear separation of declaration and implementation files

faster to compile

easier to interop with C

Resources: Obj C is old, and there's a ton of info out there on how to solve your specific problem

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

#62
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…

absolutely the same here. the problem with Swift is that it is a systems programming language and not an app-development language. far to cumbersome, complicated and unproductive for writing apps.

What makes it a systems language and not an app-development language?

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

#63
post #52

Earlier quoted context omitted.

> 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.

Since Swift UI is iOS-first, when the apps get ported to MacOS, they bring a lot of mobile-isms: the views and animations are often wrong, the controls are often wrong (like even the Apple's own settings app breaks a lot of established platform conventions and Apple's own HIGs), integration with system services is often incomplete (like proper keyboard shortcuts, I can't set a shortcut for Conversations->Delete in Messages anymore) etc.

Because of that I've seen people discuss that they have to reach for AppKit and/or ditch SwiftUI and got all in with AppKit, and that is easier to do from Obj-C.

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

#64
I've been fortunate (or not fortunate based on certain views here) to be working on a fully Swift app for the past 5 years or so. The upgrades have been painful but we've had a team helping for that process. But I don't see a good reason to write Obj-C unless I work at Apple or a huge legacy codebase anymore.

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

#65
post #32

Earlier quoted context omitted.

You’ll have an increasingly harder time adopting new Swift-only APIs For example OCR - you can use the old low quality Vision API but the new ImageAnalyzer can’t be accessed via ObjC and requires custom bridging. More and more new APIs will be Swift exclusive

I'll cross that bridge when I come to it.

In these cases I like to use the malaphor we'll burn this bridge when we get to it :) Because that's how these changes feel like.

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

#66
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…

After years of obj-c I wrote a rather larger app on Swift 1.1. I'll never forget the pain of upgrading to each new version of Swift. And my god, the pain of early swift string manipulation. 100% technical debt annually.

If there’s one lesson to take from Swift 1 and 2, it’s that Apple is comfortable launching beta APIs that can undergo massive churn. It’s why I avoided SwiftUI for the first few years, and now why people would be wise to do the same for SwiftData.

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

#67
post #35

I've given up on Apple platform development, but I strongly prefer Objective-C over Swift for a variety of reasons, including elegance, compatibility, stability, etc. It's important to note that there's still tons of Objective-C written inside Apple to this day, perhaps more than Swift. What Apple pushes as what you should be using is often not what they are using internally, FWIW. Third-party developers are its true…

Elegance. I keep hearing that from obj-c devs and I really don’t understand what is so elegant about it. Maybe it’s more to do with familiarity? I find swift much easier to deal with and more “elegant” to read.

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

#69
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.

You can use AppKit in Swift just like you can use UIKit on iOS. There is no requirement to use SwiftUI when creating a macOS swift app.

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

#70

Earlier quoted context omitted.

After years of obj-c I wrote a rather larger app on Swift 1.1. I'll never forget the pain of upgrading to each new version of Swift. And my god, the pain of early swift string manipulation. 100% technical debt annually.

If there’s one lesson to take from Swift 1 and 2, it’s that Apple is comfortable launching beta APIs that can undergo massive churn. It’s why I avoided SwiftUI for the first few years, and now why people would be wise to do the same for SwiftData.

> Apple is comfortable launching beta APIs that can undergo massive churn

You see this as a consumer, too. Apple very much moves on from old hardware compared to Microsoft.

Post reply on HN