Hacker News new | ask | show | jobs
by 9oliYQjP 1583 days ago
Apple's move to Swift and away from Objective-C won't be viewed as the no-brainer obvious decision with positive results 10 years from now, at least when both technical and business merits are considered. It will be compared in a similar light to Microsoft's big push to .NET in the early 2000s where they lost their way for more than a decade.

Apple's shift to Swift has caused a lot of software to be rewritten. It's not obvious that the reduction in software correctness bugs which Swift provides offsets the kind of bugs that are the result of rewriting software. Apple's software rewrites have introduced very little tangible benefit to the end customer while creating lots of software gremlins which are very annoying to them. Worse, focussing engineering resources on rewriting existing apps in Swift vs pushing the apps forward in terms of UX and features have allowed competition to catch up and surpass Apple in several areas that do matter to customers.

In hindsight, there will be a lingering question of if it would have been better for Apple to have continued to evolve Objective-C further in ways that could have provided similar technical benefits to Swift's introduction. At best the shift to Swift will have been seen as a necessary evil that exposed Apple's flanks. At worst, it will have been considered an unnecessary technical exercise that may have been started as a way to retain top technical talent, but even failed long-term in that respect.

2 comments

I don't know anything about the business results of Swift, but as a developer I love writing in it. And thats pretty important too, keeping devs happy
Agreed, but there's a higher baseline mental overhead due to increased complexity of Swift that Objective-C doesn't have, at least once you get past the weird square bracket syntax. This is mental overhead that distracts from the actual problem needing to be solved.

Swift isn't alone in this respect. I think TypeScript is another example of a language which started out claiming to offer a better experience than Javascript only to become very complex. I'm sure that this added complexity helps some programmers some of the time. But just like CISC was a dead end and all computer chips are essentially RISC-based today, I suspect the pendulum may have swung too far in terms of adding features to some of these developer-friendly languages.

But, it's a contrarian view for a reason. I'm just somebody who fell in love with the simplicity of Objective-C almost 20 years ago, before the iPhone was a thing. So I may be looking back at things with rose tinted glasses.

I couldn’t quite get behind the initial assertion but I agree with this one, that Swift results in more complicated, clever code. Objective-C though had more convoluted, “unsafe” code (think swizzling and nil checks). I think in the end Swift requires less unit testing and is (usually) easier to read and make assumptions which increases velocity, doubly so if you can avoid being fancy (looking at you Generics).
Unfortunately, Swift is a completely different language with the completely different runtime. I wish they took the Java/Kotlin approach and used the same runtime.

However, it is far easier to read and learn than objective-c. All of our new software is written in Swift and we will never go back to objective-c.