News for hackers. Stuff that matters.
Re:The State of SwiftUI by dimitrios1 on Monday September 14, 2020 @01:55PM (#24473062)
I agree with your counterpoint, but you don't have many other desirable options.
Re:The State of SwiftUI by Wowfunhappy on Monday September 14, 2020 @02:01PM (#24473134)
I'm not really a developer myself, but I get the impression there's plenty of long-time Mac developers who like/enjoy making Cocoa apps with Objective-C and Swift, particularly in comparison to doing the same on Windows.

Outside of web-based technologies, what would you consider a "desirable option" for making UIs?

Re:The State of SwiftUI by anoncareer0212 on Monday September 14, 2020 @02:07PM (#24473185)
We do, but, it's mostly because we were raised on it and have a lot of ingroup memes for discrediting other options - my company forcing me to work outside iOS for the first time in several years was a real eye-opener.

I don't think Apple developers have the experience to see how far behind SwiftUI is and how little chance there is of them catching up, and I don't think non-Apple developers have the experience to see there's very little 'special' to ObjC or Swift.

Re:The State of SwiftUI by matthewmacleod on Monday September 14, 2020 @02:28PM (#24473422)
Hmm, I don’t recognise this characterisation. I have been a web front-end specialist for quite some time, and have also developed large-scale native UIs for both macOS and iOS. My perspective would be that there is no clear winner. The Apple environment is absolutely _miles_ ahead of the web platform in several respects; the web offers greater flexibility that comes with a corresponding cost.

I’d agree at least that platform-specific developers can often keep themselves far too isolated. They really should be making an effort to work cross-platform as much as possible, because learning about the different patterns and techniques used in different environments is an incredible force multiplier.

Re:The State of SwiftUI by pookieinc on Monday September 14, 2020 @02:43PM (#24473570)
As someone who is also a front end dev, can you share more? I’ve been getting into Swift development on my free nights, but between the horrendous Xcode IDE errors / lag and learning the ins and outs of a new strongly typed language, it makes me hug my vscode / js environment tighter to my chest
Re:The State of SwiftUI by anoncareer0212 on Monday September 14, 2020 @02:46PM (#24473610)
Maybe I'm conflating 'web framework' with 'anything that compiles down to JS'? It's impossible for me to think of areas where iOS dev felt miles ahead, but I can imagine if I was writing JS I'd feel that way (I'm really into Flutter lately)
Re:The State of SwiftUI by wayneftw on Monday September 14, 2020 @02:55PM (#24473735)
> The Apple environment is absolutely _miles_ ahead of the web platform in several respects...

Such as?

In any case, I'd assume those miles are only gained on iOS where Apple has gimped the newer web APIs.

Re:The State of SwiftUI by matthewmacleod on Monday September 14, 2020 @03:23PM (#24474039)
Such as?

Picking some features I like entirely at random: libdispatch, Core Data, comprehensive accessibility support, SpriteKit, Core Video, ARKit… basically, there are lot of powerful and reasonably consistent APIs (with good performance) that really make a bunch of development much more tractable. Some of these can be replicated on the web platform; others can't.

In any case, I'd assume those miles are only gained on iOS where Apple has gimped the newer web APIs.

I'm sure you appreciate why that kind of attitude is a bit silly and serves to demonstrate the exact effect I was initially talking about.

Re:The State of SwiftUI by anoncareer0212 on Monday September 14, 2020 @04:15PM (#24474599)
There's no way you think Apple is miles ahead on async programming and ORMs, the iOS community has been clamoring for replacements for both for years and there's _plenty_ of web libraries for both.

The rest looks like it's focused on graphics/stuff you wouldn't do on the web anyway - yes, the fact it's impossible on the web _means by definition Apple is miles ahead_, but claiming Apple is overall miles ahead on dev experience because of AR and video bitstream manipulation APIs is a bit blinkered, given very few developers get to use those APIs.

Re:The State of SwiftUI by rabenfrass on Monday September 14, 2020 @06:33PM (#24475908)
We’d like a swift version of Core Data (a graph of objects), not a ORM. For async programming we have GCD and reactive libraries, async await is on master already, a design document is expected this month.
Re:The State of SwiftUI by wayneftw on Tuesday September 15, 2020 @12:56PM (#24483514)
> Picking some features I like entirely at random: Yada1, Yada2, Yada3...

Those are not features. Those are names of developer libraries.

What do you think they can do that's so much better?

> I'm sure you appreciate why that kind of attitude is a bit silly...

Apple clearly nerfs the web on iOS and there's nothing silly about acknowledging that. It's actually kinda silly pretending that they don't xD

> and serves to demonstrate the exact effect I was initially talking about.

Hmm, that's not very clear at all. You said "platform-specific developers can often keep themselves far too isolated", but the web isn't "platform-specific" it's 100% cross-platform and that's why Apple hates it.

Re:The State of SwiftUI by millstone on Monday September 14, 2020 @03:31PM (#24474144)
Table views are the most striking example. Native table views were designed from the start to lazily load items, and so can trivially support very large lists.

The web has no APIs for this. Instead laziness is tacked on through JS, and invariably breaks find, scrolling, etc. Try scrolling to the bottom of your Chrome history: the scrollbar jumps and it's often not clear if/when you reach the bottom.

Re:The State of SwiftUI by anoncareer0212 on Monday September 14, 2020 @04:19PM (#24474650)
UITableView was a solved problem on the web by 2014 at the absolute latest.

iOS has scrollbar jumps unless you know the rendered height of every list item and the complete count of list items in advance (which is why Chrome jumps, it doesn't know the entire length of your web history, it's loading it in batches)

Funnily enough, _SwiftUI doesn't support lazy table views_. Seriously. It's nuts.

Re:The State of SwiftUI by millstone on Monday September 14, 2020 @05:47PM (#24475516)
Of course Chrome knows the length of your web history: it's a trivial SQLite call. They just can't display it naturally, because there are no browser-provided APIs for lazy tables.

I do not agree that the JS implementations have "solved" lazy tables: they're all invariably broken. For example if you hit cmd-A to Select All, Chrome history just selects what is faulted in. If you scroll down eventually you find unselected items. Safari doesn't have this problem and the main reason is its use of native tables instead of web tables.

I agree this is a big hole in SwiftUI as well. A lazy table requires cooperation between the framework and the app, which is an awkward fit for declarative UI frameworks like SwiftUI and the web.

Re:The State of SwiftUI by nmjenkins on Monday September 14, 2020 @10:42PM (#24477390)
While it's not built in, this is totally solvable in a performant way on the web. Fastmail's web UI lazy loads in mailbox lists of messages (which for some users can be 1,000,000+ items long). The scrollbar is correct and you can jump to an arbitrary point. You can select all. We've had this for, I dunno, 7+ years now?
Re:The State of SwiftUI by millstone on Tuesday September 15, 2020 @12:19AM (#24477841)
Fastmail is indeed a radical outlier on this front, by far the best of the bunch. Its lazy tables are still broken (Find and Print for example) but they get scrolling right, and that is significant.

It's not at all representative of the experience of using Gmail, Ymail, Hotmail. The web requires heroics to get quality.

Re:The State of SwiftUI by Razengan on Monday September 14, 2020 @06:25PM (#24475836)
Let's not forget accessibility. Apple seems to be the only major company who takes it seriously, and it shows.

macOS accessibility features alone have generally been light years ahead of Windows, for over a decade.

Re:The State of SwiftUI by kitsunesoba on Monday September 14, 2020 @07:04PM (#24476146)
Also, just having a standardized way to do a lot of things.

One such example is menus. Just about all Mac apps — even ported stuff using third party UI toolkits — hook into the standard menubar APIs, which means that every menu item of every app can have a key shortcut assigned (or reassigned) in System Preferences, even when the app's dev never bothered to add such configurability. Similarly, accessibility and scripting APIs can reliably grab the menu items of any app, improving automation and interoperability. One could probably even write a full replacement for the macOS global menubar without much fuss.

Compare this to Windows and Linux where it's quasi-normal for apps to implement menus their own way or eschew them altogether — there is no single way to grab menu items, just a ton of different possible ways, and if an app dev has decided to do their own thing you're just SoL.

Re:The State of SwiftUI by saagarjha on Monday September 14, 2020 @03:20PM (#24474003)
Accessibility? Consistency? Performance?
Re:The State of SwiftUI by cglong on Monday September 14, 2020 @02:30PM (#24473439)
I'd love to learn more. What technologies outside iOS have you used and what do they do better than SwiftUI?
Re:The State of SwiftUI by anoncareer0212 on Monday September 14, 2020 @02:44PM (#24473583)
React Native, Android Java, Android Kotlin, Flutter, Jetpack Compose

- Flutter is the runaway winner, in general

- ARC looks like a mistake in retrospect - you trade 'GC overhead' for memory leaks

- keeping autolayout _and_ absolute frames looks like a mistake: a significant portion of SwiftUI overhead is spent in autolayout

- after working with Swift and _loving_ it between Swift 1 and 4, seeing the issues and watching Apple staff up and get more rigorous to solve them, stapling SwiftUI right now is unconsciable

- it requires contorting the language spec and the slow speed removes the one benefit of all the other frameworks, hot reload on device.

- Apple seems confused because they can _enumerate tractable work that would improve SwiftUI_, but the sum of that work is large enough to place a real, performant, cross platform Swift UI O(years) out (c.f. Swift's stable ABI clusterfoo)

Re:The State of SwiftUI by mdgrech23 on Monday September 14, 2020 @02:46PM (#24473618)
I don't know much about SwiftUI but I'm surprised to hear it's far behind?
Re:The State of SwiftUI by kenver on Monday September 14, 2020 @07:20PM (#24476243)
At this point I actually prefer the cocoa methods of creating UI. This kind of tech also affects the architecture of the app that is utilising it - SwiftUI and the like seem to be quite prescriptive in terms of application structure, whereas with cocoa I feel that I have a lot more possibilities.
Re:The State of SwiftUI by Razengan on Monday September 14, 2020 @06:21PM (#24475819)
> but you don't have many other desirable options.

How did people make iOS/macOS apps before SwiftUI? i.e. before 2020?

Re:The State of SwiftUI by dimitrios1 on Tuesday September 15, 2020 @09:21AM (#24480876)
Apologies, the operative word was desirable. SwiftUI, at least in theory, has made the other options less desirable.
Re:The State of SwiftUI by grishka on Monday September 14, 2020 @10:17PM (#24477268)
So are you developing for the sake of the process or for the sake of the result? The result is always faster and lighter if you don't pile additional abstraction layers on top of whatever your platform offers (DOM for web and Cocoa/AppKit for macOS).