原文
原始链接: https://news.ycombinator.com/item?id=41484634
应用程序为用户提供了许多好处,特别是那些使用 iPhone 的用户,他们可以轻松地从 App Store 下载应用程序。 然而,它也存在一些缺点,包括用户的成本以及寻求创建移动设备专用应用程序的开发人员面临的重大挑战。 我的公司面临的一个特殊问题是开发一款需要使用人工智能和相机功能的移动应用程序。 当尝试使用 Swift 本地开发应用程序时,由于第三方库和 API 支持有限以及文档不足,出现了一些挑战。 此外,虽然 Swift 有其优势,但它缺乏 C++、Java、C#、Python 等语言所具备的成熟度和强大的生态系统。 最终,在开发过程中遇到各种挫折后,有必要考虑替代方法,例如使用 Web、混合应用程序或 Flutter 等其他平台,而不是原生 Swift 开发。
Cost can be a downside, of course.
For vendors the obvious downside is the Apple/Google tax, and is something even we need to be wary of at the company I work for.
But it's not the only downside.
I work for a company that offers a service via the web but, recently, we wanted to prototype some functionality that would exclusively be used from mobile and tablet. It uses the camera, does some nifty stuff with AI (and, to be clear, no, it's not a porn app!), etc., and I thought well, why not prototype it with and app? And, furthermore, why not prototype it as a native app with Swift? This should be the lowest friction route to ddeveloping and deploying an app to iOS, has full access to the platform's extensive built-in capabilities, and therefore it would offer the best user experience, etc.
And I've always been happy to sacrifice a quantity of developer convenience for the sake of offering a better user experience. At the end of the day if we, as engineers, wanted easy jobs we picked the wrong career: we should be aiming to make the lives of our users easier and more productive, and that's often really challenging.
And I'll tell you what: as far as it goes, if I didn't need the app to interact with anything outside of Apple's platform I might still use Swift. It's a nice language, and whilst XCode feels a bit like it Deloreaned in from 2005, it isn't completely terrible.
But that's not our app. It needs to integrate with a bunch of other services and here is where the pain kicked in. Swift and iOS are absolutely the poor cousins when it comes to library and API support. For so many things I wanted to do libraries were incomplete, and documentation was... well, it ranged from non-existent to wrong in critical aspects.
And because Swift is niche (relatively speaking) it's very evident that it doesn't have the kind of mature ecosystem, thought leadership or best practices around it that the likes of C++, Java, C#, Python, and others do. I might be speaking out of turn here but I also get the vibe that it doesn't attract the kind of best of breed practitioners that other more niche development platforms have, which yields better library and API support for them even though they don't necessarily have huge developer bases: think Go, Rust, Flutter, etc.
I don't want to denigrate Swift because, as a language in isolation, I liked it (even though it's Objective C underpinnings are never far from showing themselves). But as a development experience, it was a complete nightmare. Outside of functionality that depended only on the device itself I struggled to get anything working well.
You could put this down to, well, you're new to the platform, what do you expect? But I was able to otherwise be immediately productive in Python 18 months ago when I started working with it, and didn't run into these kinds of frustrations.
In the end I literally got to the point of, screw this, let's just use web, or maybe a hybrid app with the thinnest of thin native wrappers, or maybe flutter. But not native, no way.
[0] I say little anxiety rather than no anxiety because I'm not generally a fan of free apps the serve ads, where you don't really know what's on the other end, or how they might be tracking you, and often the UX is such that it's made a bit easier than one might ideally like to accidentally click an ad.