Today I discovered that I do not like Swift coding, or feel it necessary to exist as a different language.
It's C/C++ like, but with obscure little quirks that aren't intuitive:
self.window.rootViewController?.title
(What's the ? for? It's tricky to even Google it)
The Apple page pushes it as an ideal first language.
self.window.addSubviews(self.btnOperations)
_ = self.btnOperations.map {
$0.addTarget(self, action: Calculator.onOperationPress(_:_:),
for: .primaryActionTriggered)
}
And the people who write examples of it are not the best people to take progamming lessons from:
if Double(self.state.lhs) == 0.0 { break }
(protecting against a division-by-zero!)
About the only nice thing I can see is that UI primitives are one-liners to create, but that's true the second you include any UI library.
Does nobody make a decent, readable language any more?