Ask HN: Is there much future in being a Swift developer?

10 points by windowshopping ↗ HN
I'm a web developer who really likes the look of Swift-- I would love to be writing code in it.

My concern is that it's only used by a narrow range of products -- Android has taken something like 90% market share in mobile phones and I worry that in the long run Swift and the Apple frameworks aren't a good investment as a developer.

What are your thoughts?

14 comments

[ 3.9 ms ] story [ 42.9 ms ] thread
It is difficult to predict these things. If you are targeting the web (as you mentioned you are a web developer), I would say it's very hard to bet against JavaScript, for good or bad. However, I think the future for Swift devs is bright as long as they are willing to specialize on Apple's family of devices.
It's quite some years in and traction for backend web development in Swift seems to remain low. There's a small community which is excited by doing that, but in betting terms I doubt the language is going to take off outside of writing Apple-platform apps.
I don't know where you're getting your numbers or where your users are, but Android doesn't have a 90% market share either by users or revenue. At least in the US, iOS represents a majority of both.
Apple isn't going anywhere, there's plenty of future ahead for Swift. I wouldn't count on it catching on outside of their walled garden though (like web dev).
> My concern is that it's only used by a narrow range of products

Yeah, the range of products is indeed narrow. But narrow in this case is 1.35 billion iOS devices (not even factoring MacOS).

> What are your thoughts?

iOS isn't going anywhere in the near future. You can have a long and happy career as an iOS dev. Build a few apps, apply for a job, give it a go. If it fails or your hate it, jump to something else.

check how the community is doing relative to communities of similar age
Why not Kotlin? Kotlin has a lot of parallels to Swift: https://www.raywenderlich.com/6754-a-comparison-of-swift-and...

If you think Android is 90% of the market and considering Kotlin is seeping rapidly into Android, this is a great time to do it. It's interchangeable with most of Java.

Would you say it's better for him to learn Kotlin over Dart/Flutter? Seems to me that Flutter might be a better bet?
I don't know anything about Dart, though. I'm not keen on Flutter, for a number of reasons, namely some lower level things. The company I'm in took a long hard look at whether we'd do Flutter or native, and we went with native because it gave us more control and is more predictable.

Kotlin offers much of what Swift does, both try to adopt the same features as the other. It does pseudo-functional programming nicely, which is what a lot of people look for these days.

If you want to compare career paths for both, Dart/Flutter is still early and doesn't have enough data points. Kotlin's popularity grew at a similar rate early on, despite no MFAANG backing, and now Google is officially replacing their docs with it. The fact that Google pumps out so much recent effort into building up both native Android/Kotlin and Flutter/Dart means something, but on a gut feel they're investing more into Android/Kotlin/Jetpack.

The beauty of iOS over Android is one of cohesiveness. Android seems "balkanized". Is something deployed guaranteed to work across all Android devices? I'm firmly in the iOS camp as an end user and my now-decreasing development efforts are on Linux, primarily Python and Bash (systems deployment and maintenance). Android, while nice on a Pixel (friends) seems almost broken on other devices.
This might be the case 7 years ago, but since Android Jetpack, a lot of Android development has been standardized. It used to be that it behaved differently across manufacturers with things like camera and file systems, but even this functions roughly the same these days, with CameraX and the newer media permissions.
I'm not sure why but I enjoy working in Swift. It just feels fun. I'd love to use it for backend or web development, but currently if I'm not targeting iOS or Mac, I don't use Swift.

You raise a good question about whether the investment is worthwhile, but if you earn money from targeting Apple platforms then it's a no-brainer.

When I was in the game industry, pretty much everyone I knew had the attitude that you had to be an expert in one language, C++, and it was career suicide to take a job working in a different language. But I've always felt that there's nothing wrong with using multiple languages. Over the course of my career I've had to use many different languages, at this point it doesn't seem like a big deal pick up another one. When I had to do a Unity game, it seemed like it took less than a month to get ramped up on C#. Just this year I've jumped back and forth extensively between Swift, Typescript, Elm, Elixir, Python, and Golang, while also doing some small projects in Agda, Haskell, and a few others. Yes, I do get the syntax mixed up, particularly right after a transition, and sure, I'd probably be more hireable if I honed my skill in a single language, but really learning a language is not such a big investment once you get the hang of it.

The Apple frameworks are a different story -- that's a bigger time investment, but it's incremental. You don't have to learn all of them to make an app, or to be productive in Swift.

[edit: fix typo]

If you go back in time 15 years, and ask yourself if it would have been a good idea to be an "Objective-C" developer, I think the answer would have been "not really, unless you only want to develop for MacOS". Swift is in pretty much the same situation, but for MacOS and iOS.

There's no right or wrong answer here. Personally, I wouldn't define myself solely by using a single language. After working on projects using various domain-specific languages like 4GL and others, I would certainly bear in mind the risks that such a commitment would entail.

While other commenters have mentioned the large iOS market share and the size of Apple, I would also caution that neither guarantee the longevity of the language or the relevance of your skills if they ever decide to pivot to something new. And there's plenty of historical precedent for that--I'd argue that it's a matter of when, and not if, it will eventually be replaced.

Swift might eventually see wider adoption on other platforms. However, people are rightly cautious of vendor-specific and/or vendor-controlled languages, and I suspect its traction, like that of Objective-C, will remain low.