5 ms·
I'd be curious to hear from iOS devs what they think is going on here. Did anyone try moving to Swift and what was the specific reason for going back to Obj-C?
by VectorLock 7y ago
I'd be curious to hear from iOS devs what they think is going on here. Did anyone try moving to Swift and what was the specific reason for going back to Obj-C?
- exelius 7y agoI would suspect it’s because even many of the core libraries are still written in Obj-C. Swift is neat and I really like it, but the ecosystem is such that even when using it on a new project you end up writing ~25% of your project in Obj-C.
- rimliu 7y agoThis sounds extremely strange. Last time I neede to write Obc-C was early 2017. My current project started as pure ObjC, now there is zero lines of this in production.
- kitsunesoba 7y agoDepends on the nature of your project but I can count the number of Obj-C libraries I’d be likely to use in my projects on one hand, and they all play secondary roles (e.g. analytics). For almost anything else Foundation/UIKit and third party Swift libraries would be used.
- gregkerzhner 7y agoI really like Swift as a language. To me it feels more elegant and less verbose than Objective C. However, the tooling around Swift is worse, so you have to live with longer compile times and other random bugs. This drawback is still not enough to make me go back to Objective C. Also, I am not sure I get the argument about ecosystem - you can easily include Objective C dependencies into Swift projects.
- asaph 7y ago> Swift is worse, so you have to live with longer compile times Is this truly a factor? Aren't the vast majority of mobile apps relatively modest in scope due to the very nature of the platform? How long does it take to compile an average Swift app?
- rimliu 7y agoI doubt it. It was worse but now just good enough not to care too much.
- saagarjha 7y agoDepends on your scale. A clean build of my medium-sized app takes a couple of minutes on my machine, but most large apps rely on dozens of frameworks and have lots of code in them and can take tens of minutes to build.
- pixelrevision 7y agoSwift can be pretty bad due to how much the compiler wants to guarantee. Doing certain things can also really make it take a long time (like doing a ton of casting on a dictionary). I personally think it’s worth it and saves me a ton of time other places but I do have warnings for most of my projects for if a function is taking too long to compile.
- mpweiher 7y ago> Is this truly a factor? Yes. Every Swift project I am aware of fights with this problem. Two of the CocoaHeads Berlin talks in the last year or so were about workarounds for slow Swift compile times. For one, I computed the compile speed for the frameworks in question, it turned out to be in the double digits of lines / second. That's not bad, that's truly horrific, starting to get into "transcribe into machine language by hand"-joke territory. The other talked about splitting all their UI features up into little mini-frameworks in order to be able to work on this one feature in isolation without having to compile the rest of the app. While I am a great fan of framework-oriented development, that's not really how that's meant...
- oflannabhra 7y agoMy impression (which is just anecdata): there is plenty of Objective-C out there, and migrating it to Swift is such a significant effort that it likely won’t happen. Swift however has significant mindshare, there are even Swift-only iOS devs. Lots of developers and most materials have shifted to Swift. That’s where the excitement is. Swift interopts with Obj-C well. Lots of development has switched over to Swift, even if the rest of the codebase remains Obj-C. There will still be plenty of Obj-C jobs over the next 5 years, but there will be more Swift oriented jobs. Swift is also making strides into other areas: Swift on the server is growing, Swift on Linux and Windows is improving, and Chris Lattner is forging ahead with Swift for Tensorflow. Whether it is successful in any of those beachheads remains to be seen, but there is significant effort going towards them.
- raydev 7y agoI think the ranking is meaningless. VB.net over JavaScript? Assembly over Ruby?