Re:Swift Evolution: Actors
by sai_c on Wednesday March 17, 2021 @02:14AM
(#26487219)
Every time I read about new Swift features, I'm reminded of this paragraph from Aaron Hillegass's book "Cocoa Programming for Mac OS X". I don't know why.
[ Parent
| on HN ]
Re:Swift Evolution: Actors
by BakaRakuda on Wednesday March 17, 2021 @05:44AM
(#26488704)
You can literally create the app described in his quote in about 2 minutes flat with the following lines of code...
import SwiftUI
@main
struct FooApp: App {
@State private var isClicked: Bool = false
var body: some Scene {
WindowGroup {
VStack {
Button("Click me!") { isClicked.toggle() }
if isClicked { Text("Hello, World!") }
}.frame(width: 640, height: 480)
}
}
}Even in the objc-cocoa days, you could create a .xib, drag a few connections, and have this working with 10 lines of code (8 of which generated automatically by XCode)
Re:Swift Evolution: Actors
by pindab0ter on Wednesday March 17, 2021 @02:42AM
(#26487354)
It’s a funny excerpt, but I don’t see how it’s relevant to this. It seems to me that the whole point of introducing actors is to reduce complexity.
Re:Swift Evolution: Actors
by midgetjones on Wednesday March 17, 2021 @05:31AM
(#26488557)
The main moral of this story is that people like to claim hindsight for some sort of psychic power.
As I said, I really can't put my finger on it, but maybe it is this (tongue in cheek).
Taligent: The whole point of adding all those abstractions is to reduce complexity.One of the funny things about our industry is that when our smartest really give their best to do The Right Thing™, we get Taligent and Swift.
And when people do everything "wrong", we get amazing things like Smalltalk and Cocoa.
Hmm...
What's wrong with Swift? It's a massively popular language
Re:Swift Evolution: Actors
by alfonsodev on Wednesday March 17, 2021 @05:59AM
(#26488834)
Remember Swift is also used in the backend and other areas that are not UI, not every new feature in Swift will be oriented to make UI apps easier, for that you have Swift UI the framework.
We don't get this type public proposals for Swift UI, I wish Swift UI would be open source, because the documentation hasn't been great in my experience and at least this type of proposals get publicly documented and discussed before being implemented.
Re:Swift Evolution: Actors
by bigbizisverywyz on Wednesday March 17, 2021 @07:50AM
(#26489756)
Funnily enough I just recalled this quote recently when casually looking over this page about WinUI3 : https://docs.microsoft.com/en-us/windows/apps/winui/winui3/x...
The whole XAML/WPF thing just seem to me a bit of a dig's dinner.