4 ms·
Yeah they have some syntactical similarities, like `if let`, and no parentheses with if's and for's. I really miss `guard let` in Rust! (I've heard it's coming
by dceddia 4y ago
Yeah they have some syntactical similarities, like `if let`, and no parentheses with if's and for's. I really miss `guard let` in Rust! (I've heard it's coming at some point though?)
Swift leans real hard into verbose method names, just like Objective C did, and Rust is pretty much the exact opposite there. When I was writing more Swift I got used to it, and actually started to like it. And now that I'm in Rust a lot, I like the brevity.
I think Rust nudges (forces?) me to write code that's architecturally better, with fewer interdependecies. It was hard to get used to though. In the beginning I kept trying to make structs that started threads, where the thread called methods on the struct, and that was just a recipe for big pain.
Swift, on the other hand, especially with the way the macOS and iOS frameworks are designed, relies a lot on MVC, delegates, and mutability, which gets hard to keep track of.
- Klonoar 4y agoIt’s interesting you say that Swift leans hard into verbosity - I’ve found the opposite. Most of the verbosity often feels like it exists due to ObjC “lineage”. (I say this as someone who likes verbosity)
- dceddia 4y agoInteresting! Maybe we're using different definitions of verbosity too, or I used the wrong word there. I was thinking more about the long method names which definitely do feel like they're carried over from ObjC. And then, a lot of those names are really more from the commonly-used frameworks than the language itself, so maybe it's not fair to say that "Swift" has those long names, but it does feel like the 99% use case for Swift is using those frameworks. I think I agree that Swift felt like it needed less code to do a thing than ObjC would have, in a lot of cases.
- adamnemecek 4y agoThere’s also SwiftUI.