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 UIViewCon…
Ask HN: How many of you Apple developers still use Objective C?
121–130 of 160 posts
Re: Ask HN: How many of you Apple developers still use Objective C?
#122Earlier 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.
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?
#123Earlier quoted context omitted.
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 Me…
> "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." You can fairly easily port UIKit apps to macOS now with Mac Catalyst[1] No need to use SwiftUI to get those mobile-isms. [1] https://developer.apple.com/mac-catalyst/
Re: Ask HN: How many of you Apple developers still use Objective C?
#124I do, but not often. Got my start in Objective-C back in the 2000s tinkering with OS X apps and used it at work for writing iOS apps from 2015-2017, but I embraced Swift pretty quickly (IIRC I started to take it seriously around 2.x). It required significant shift in mental models, but having so much more built into the language (needing fewer dependencies is never ever a bad thing, especially when using CocoaPods),…
Re: Ask HN: How many of you Apple developers still use Objective C?
#125Earlier quoted context omitted.
> Given C is faster and more mature than ObjC, why aren’t you writing everything in pure C and objc_msgSend? TBH your question feels trollish, but I'll respond anyway. Objective-C code does compile to objc_msgSend calls. Perhaps you meant getting the method implementations directly and calling them instead? Objective-C is 40 years old. How much more mature does it need to be?
You said you make the utilitarian choice. By using C everywhere, you can use an even faster compiler that doesn’t insert those calls for you. So why don’t you?
Re: Ask HN: How many of you Apple developers still use Objective C?
#126Re: Ask HN: How many of you Apple developers still use Objective C?
#127Earlier quoted context omitted.
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 Me…
> "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." You can fairly easily port UIKit apps to macOS now with Mac Catalyst[1] No need to use SwiftUI to get those mobile-isms. [1] https://developer.apple.com/mac-catalyst/
Re: Ask HN: How many of you Apple developers still use Objective C?
#128Nobody makes Cocoa (AppKit) learning resources anymore, especially not in modern Swift, but Objective-C ones still work to this day.
I'm sure I'll switch to Swift eventually, but even macOS Sonoma is still 53% Objective-C code, so if I really want to grok it, I have to have at least some knowledge of the language. Even if Swift is better, this will still help me learn why it is better.
Re: Ask HN: How many of you Apple developers still use Objective C?
#129It is _insanely good_ to my eyes since I’ve done ObjC since the NeXT days and find Swift full of weird corner cases and limited functionality.
Re: Ask HN: How many of you Apple developers still use Objective C?
#130I've been programming for 56 years. Over that time if I had changed languages without a compelling reason, it would have been a huge waste of time, energy, and peace of mind. I'll stick with objC until I am compelled by practical reasons to change.