Hacker News new | ask | show | jobs
by runjake 856 days ago
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 beta testers.

3 comments

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.
It's subjective, but from my viewpoint, the message passing and it's relative simplicity and readability, compared to Swift.

I can completely see why people would think the opposite, though.

Message passing is neat, but every time I saw someone take advantage of its flexibility, it was a mess.

E.g. there was a Flickr API library that directly translated the message names into API calls. Very neat, but now a typo stops being a compiler error and becomes a failed API call.

Mostly it was used to bypass Apple's private API App Store restrictions by obfuscating message names in rot13 or something.

Message passing is nice. Swift just has function calls like any other OOP language.
You could probably say the same about most large public orgs. For instance many Amazon teams don't even use modern AWS internally for their services. At least as of three years ago.
At Google, it's really hard to use GCP for first-party products due to all the security lockdowns.
What’s the justification for security lockdowns versus what they use internally?
> It's important to note that there's still tons of Objective-C written inside Apple to this day, perhaps more than Swift.

I don’t know if this is true or not, but Apple certainly isn’t writing its own end-user applications with good macOS technologies and support (which means it’s not using Objective C and Cocoa). Apps like Reminders, Notes, Photos and others on macOS seem and behave like poorly ported versions of an iOS app.

In user space perhaps, but the OS is very heavily ObjC (and C)

Someone posted a great analysis breaking down how many binaries used which language in iOS through the years