4 ms·
This is a bad argument. Just because there’s a lot of chatter about Swift, doesn’t mean there’s more Swift code than ObjC out there. Of the 31 apps I have insta
by kirb 10y ago
This is a bad argument. Just because there’s a lot of chatter about Swift, doesn’t mean there’s more Swift code than ObjC out there. Of the 31 apps I have installed on my jailbroken phone, 9 contain libswift libraries. Of course, that doesn’t even mean the entire apps are written in Swift; most of the uses I see are for app extensions probably because they’re a more recent addition. Worse on my Mac – 7 out of 94 non-Apple apps installed.
You don’t throw away good code just because “eh, I like Swift better”. Couldn’t imagine having to justify rewriting good code to my employer. If it works, you keep shipping it till it breaks, then when it does break you spend a while fixing it and continue shipping it. Only when that becomes unviable do you consider rewriting it, and depending on the developer/project situation that may very well be in Swift.
Microsoft fell into the trap of rewriting good code with the failed Windows Longhorn project – for what was meant to be a minor release, they burned a heap of time rewriting large portions of Explorer (taskbar, start menu, folder windows) in C#. Explorer in all beta releases since the rewrite began were very unstable. They scrapped it and kept the existing C++ codebase. Fast forward now, Explorer still runs great in Windows 10 with the same C++ code, right? See also the Joel on Software article everyone usually links when this topic comes up: https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/ https://www.joelonsoftware.com/2000/04/06/things-you-should-...
Music, Calculator, and a minor part of the new Messages app were rewritten in Swift in iOS 10. Dock was supposedly rewritten in Swift in macOS Sierra, ditto Notification Center. Plenty of Touch Bar code is Swift. I think the fact that they’ve started to use Swift with new non-framework code is pretty important. But I’m certain there will still be ObjC in service for way longer than Apple removes its last line of it from the codebase. It can’t just be phased out like Rosetta or Carbon, especially when 3rd party apps are what keep iPhone sales up.