I work for a company that writes iOS apps, large and small. When Swift 2 came out, any new projects we started were in Swift. We still maintain several large and small ObjC apps.<p>If I had my way while were planning out a "big" app, it would be ObjC.<p>- ObjC isn't going anywhere, and it continues to receive improvements<p>- Xcode 9 can still barely handle large Swift apps; I consistently lose syntax highlighting and autocompletion<p>- Equivalently sized ObjC apps clean build in approximately 1/3 of the time<p>Swift as a language is fine. There were some neat new concepts it forced me to learn, and I look forward to writing it. But the tools make me want to work on anything else.<p>edit: Also I was really, really looking forward to Swift 4 & Xcode 9. I hoped there would be improvements in build time and less IDE problems, but I see no noticeable change in build time, and Xcode routinely leaves me unable to quickly make changes to Swift code, either because indexing failed and autocomplete is suggesting random shit or because autocomplete isn't there at all. Then I switch tabs and for a moment I'm looking at syntax highlighting until it just... disappears. Maybe changing a line will fix it, maybe it won't. Xcode 9 might actually be worse in this respect.
I think a lot of these comments are directed at Xcode and tooling, not Swift specifically. This is unfortunately just the trend with where we are at with new desktop mac software, hopefully High Sierra's focus on improvements over features will be a turning point, Xcode 9 does seem to be on the right track.<p>When I was out of the office this week, two server side java developers helped a Swift junior step through some code - they both were really surprised and impressed at just how approachable Swift is. As well, I notice daily how few runtime errors and issues we have with Swift code-bases comparatively.<p>I think a lot of these comments are straw-manning the language. Yeah, people don't like being beta testers, or using immature and changing software vs very mature and stable software - that's not comparing two languages themselves though.
Swift is great for a small app, with a handful of developers. For a platform, which interops with multiple languages, being worked on by a large team of engineers, switching to Swift would just be silly.<p>Oh yeah, let me increase my compile times, the size of my SDK, add complications for my publishers, see zero performance benefit, build a ton of scaffolding code, add yearly tech debt until Swift is actually a mature stable language. Terrible idea!<p>It might be the gold standard some day, but for now it's just a kid compared to ObjC, and everything that comes with being a C based language. If you're learning to make apps, by all means, you should learn Swift, but it will be quite a long time before ObjC is dead and gone, so be prepared to learn both young padawan.<p>Not to mention, the hype train/bandwagon is really muddying the waters. It's probably a bad idea to take advice on how performant/powerful Swift is from a Zealot, or someone that's betting everything on it.
I’ve developed primarily with ObjC for about 4 years, and when Swift was released, primarily with that - so roughly an even amount of time with each.<p>The article has a lot of very opinionated comments, some of them not true (e.g. ObjC development has not completely stopped). There are definitely some truths in there too, like how fluid the language has been so far (last year’s Swift code probably won’t just compile this year).<p>In general, I think it’s fair enough to say that Swift hasn’t matured yet. It’s not so stable, and tooling isn’t great. Large projects might suffer from that. ObjC on the other hand is rock solid, but lacks some of the more modern language features of Swift.<p>Personally, I’m all for Swift, because it’s the future. Tooling issues and stability can (will?) change. Turning ObjC into a modern, next generation language just isn’t something that seems feasible.<p>Aside from that, Swift is a really neat language - tooling aside, I find that Swift is (mostly) a great language to write in, with features that I’d sorely miss going back to ObjC. That’s purely opinion though, I’m sure there’s others that might say the same from an ObjC standpoint.
We started using Swift on new projects. I don't hate it per-se, but as with most new languages like Rust, or Kotlin, they have some neat, modern ideas, but mostly they help solving none of the problems you have on a day-to-day basis, and instead make common coding tasks harder.<p>Using Swift feels like i'm back in college writing C++ code while following all the newest design patterns, and best practices, thinking about whether i should make two classes friends or not, instead of solving actual problems.
I think the Swift language is great, but the tool chain (specifically `/usr/bin/swift` and `/usr/bin/swiftc`) is absolute garbage. The documentation is almost non-existent, its preferred method of 'handling' errors is to just segfault, when it <i>does</i> give you an actual error message it's completely nonsensical, and as mentioned it's very very slow.<p>I think i'm a version or two behind the latest, so maybe it's better now, but that's been my experience so far.<p>Anyway, in spite of the above i still prefer it to ObjC.
For people coming from C/C++/ObjC, certain things in Swift can take some time to get used to, e.g.<p><pre><code> if case .Success(let person) = personResult { ... }
</code></pre>
My first thought when I saw this was, "only a mother could love this syntax", but later you come to appreciate and enjoy it.<p>Link: <a href="https://www.natashatherobot.com/swift-guard-better-than-if/" rel="nofollow">https://www.natashatherobot.com/swift-guard-better-than-if/</a>
All the junior mobile engineers I’m interviewing now are learning iOS development on Swift. Junior engineers are probably the most pragmatic programmers on the planet. When they’re choosing to learn Swift vs ObjC, none of them are saying “...but ABI stability!” They’re learning Swift because they’ve found they can make apps faster with it.<p>Tells you all you need to know about the future right there.
The nice thing about Objective-C is that it combines two excellent distinct languages - C and Smalltalk. Swift, on the other hand, introduces a completely new universe. Which many swear is a good thing.
No one said the future would be painless to adopt. What's obvious is that Swift most definitely <i>is</i> the future. Apple has made their commitments clear. There's no stopping that train so might as well get on-board.<p>That's my view.
For better or worse, Swift will become the only choice known by a new generation of programmers.<p>Merit and past lessons learned, are not really how concepts, practices and techniques become popular in computing. Alan Kay had it so right when when he said that computing is a "pop culture".
The real point that I think this article misses is framework development. Swift <i>still</i> has not achieved ABI compatibility. If you are using an iOS device, very likely framework code I have written in the past few years is running inside one of the many apps you have installed.<p>This is simply <i>not feasible</i> to do unless you are willing to open source your code base. I have been shipping closed source binary frameworks written in Objective-C for seven years. None of the companies I work for are willing to maintain binary releases for each version of Swift AND Xcode. It's simply too much.<p>I'd love to use Swift, but at this point it would only be a maintenance nightmare for my team and I to maintain.
Legacy code. That's the primary reason some people haven't jumped the Swift bandwagon.<p>Newness (which includes rapid, breaking changes in language and still-to-be-improved tooling) would be number two.
Here's something from the point of view of a Swift engineer who had multiple conversations with experienced Objective-C developers.<p>1st. Don't look at it from the language perspective. Look at it from the point of view of the platform and dozens of SDKs that comes with it. It's lot easier to use those SDKs in an environment you are already comfortable with.<p>2nd. There's no financial incentive for an existing app to be ported to Swift or train experienced developers to this new language. In my manager's own words, "...you have to give me a business justification to port our app to Swift..."<p>3rd. I'm afraid to say that incredibly high inertia about learning and embracing a new language, and letting go of your stronghold.<p>Swift is an amazing language, and it's quite easy for you to switch between Swift and other C-style language e.g. ECMAScript. Objective-C has somewhat obfuscating syntax that makes it intimidating for beginners.
Is Apple really pushing for swift to be adopted in schools and colleges? Given that it only runs on iOS and MacOS (expensive platforms) and that you need to pay some fees just for the privilege to create your own iOS app, it's not an obvious candidate in my mind, irrespective of the language's own merit.
It's pretty awful- there's not a lot more beginner material for Objective-C anymore. Even if you think it's for legacy work only (Facebook and itself have a word with you), it's still needed to learn. Many many apps are too big to rewrite in Swift. Don't discount your roots.
Wow, that was quite a whining article. I mean, I doubt I'll ever forget Obj-C but Swift is now my goto language for iOS projects. Reminds me of when I was reluctant to abandon assembler for C. Get over it.
I wonder how long we will keep hearing the complaint that Swift keeps changing. I never saw that as a problem at all, 99% of the changes have been for the better, and most of the time it's exactly the things I have wanted them to change, or add.<p>For the first few days after the announcement I couldn't see the point of Swift, why did Apple feel they needed a new language? It's not like there was a dearth of developers in objc. I started reading the Swift book from Apple though, and when I finished it a few days later I was hooked. Since then I haven't voluntarily written a single line of objc.<p>Of course circumstances may vary but for us migrations between Swift versions, even the biggest ones, have never taken more than 2 hours. Learning the new syntax as a developer I see exclusively as a positive, it's exciting to see how it develops. WWDC is Swift Christmas.<p>Again, each project and each developer is different but I can't shake the feeling that at least some of the objections raised by obj c diehards sound like pretexts, especially the talk about the language being in flux. It's not like you're forced to adopt the new version immediately, and in any case APIs also change. It's just part of the job. And Swift can't improve if it's not allowed to evolve.
I'll just add my 0.02 and say that for writing games, at least, I cannot imagine a better language than Swift, unless it's a slightly better version of Swift.<p>Combined with SpriteKit/SceneKit/GameplayKit/Metal, it's a decades-long dream come true.
Swift is a really cool, but in many ways more complementary to ObjC than a particularly great replacement for it. A lot of the things uniquely interesting about ObjC (truly seamless C/C++ interop, tiny lightweight runtime, learnable in an afternoon for C users) are explicit non-goals of Swift. So it’s not surprising that developers who found ObjC to be a good fit for their problems aren’t always finding Swift to be the right tool.
Swift is a good language. Especially if you are new to Apple ecosystem. Objc looks ugly and scary. But after 5 years of objc, I actually like the bad things about it lol<p>What I don’t like about Swift is that it evolves every year. I already need to maintain new OS updates and new devices. I don’t want to have another thing that I need to maintain... especially the language itself.
While legacy iOS developers are justifying objective-c over swift. Swift is “eating the world” of iOS and macOS app ( and some server side ) development, avoid it at your own peril. The Xcode issues are undeniable but it does not change the situation. swift lang is superior and it is the overwhelming choice for new apps and new developers.
Say a fund constrained startup, with single iOS developer who is experienced in Objective C. There’s no reason to go for Swift if building MVP is priority; as it should be for any startup. If compile times are longer in Swift, it increases cost on new hardware as well.<p>So cost plays an important role in the adoption of Swift as well.
I primarily develop iOS apps in C++ so using Objective-C for the platform stuff is a no brainer thanks to mixing that language with C++ in the same source files.<p>I really like Swift though and hope tooling improves so I can start doing more with it. I love its approach to type safety and offerings like ADTs.
in some ways these complaints remind me of trying to pick up Haskell or Rust -- tooling isn't quite there, breaking changes all the time, outdated resources online. funny that Swift, another "weird" type-heavy language, has the same problems.<p>i wonder if part of the IDE problem isn't to do with having the elaborate type system. it might make certain things easier but having to do inference could slow things down a lot.<p>my dream is that someday Swift will be a mature, well-funded, "enterprisey" language that is also weird and functional. Something to join the ranks of F#.
Swift is nice although it doesn’t have any advantages for someone who knows objc. Plus for interoperability you still need to know c/objective c anyway, and then why bother.<p>I guess Swift is popular with JavaScript developers, coming from web dev.
I shall add this to my HN thread generation algorithm:<p>- article queries developers of category X: why do you do Y?<p>- 1000 replies appear as variations on the theme 'no, it's just because Z!', clearly implying category X either lacks the ability to introspect on their own reasons for their choices, or are perhaps knaves or fools
> Steve Troughton-Smith: Fully excluded; a Swift-only conference is one that has nothing for me. I don't want to have to care about Swift best practices or design patterns now before the language is fully formed and before Apple is using it at scale. I don't want to collate a dozen community-led design patterns, I want to do what Apple does.<p>So if it's not endorsed and spoon fed by Apple, he wants nothing to do with it.
I'm surprised by the resistance of some of these iOS developers. You would think that after years of developing in a language that looks like diarrhea they would have gleefully switched over to Swift.
Uhh because Swift threatens their job? Objective-C is an abomination, which has kept Python/Ruby/JS developers away. Swift on the other hand greatly simplifies switching between, JS,Python,Swift. From employers perspective this opens up a huge talent pool, for employees especially the Objective-C hipsters its a bad news, since their privileged status in the app economy is now under threat.<p>I don't see any sane new startup/projects using Obj-C, other than bullying by Obj-C devs.