What are your thoughts on Swift vs Rust? I’ve used Rust and another engineer showed me guard let statements from Swift, which gave me the impression they had some of the same sensibilities.
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.
It’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”.
Interesting! 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.
They share a lot of similarities. Both make it hard to do unsafe things, both have functional influences, both have modern features like closures, optionals etc. I'd say the biggest philosophical difference between the two is that Swift leans more toward developer ergonomics while rust is geared toward system level programming (ie tighter control over memory etc).