3 ms·
> [Swift] values expressiveness, and having multiple ways to do things that means you can choose a nice way to express each line, rather than always being force
by gary17the 4y ago
> [Swift] values expressiveness, and having multiple ways to do things that means you can choose a nice way to express each line, rather than always being forced to write it the same way.
There are at least two major problems with this kind of PL design approach: 1.) when you work on a large codebase from multiple contributors, all the possible combinations of the available syntax and standard library calls will eventually get used, making your brain frustrate quickly when reading code written by others, and 2.) when you interview for a new job, all the possible combinations of the available syntax and standard library calls will eventually be asked about by interviewers, making you look and feel like an incompetent programmer.
I have to agree with the OP - Swift seems to be an unreasonably bloated PL. Unless one plans to work only with Swift all the time, learning all there is to learn about Swift on the way, it might be easier to just use Rust or Go.
- dagmx 4y agoRust and Swift have about the same amount of syntax imho, and often share a lot of it. Go is simpler as a language but you end up writing more code to accommodate that.
- gary17the 4y ago> Rust and Swift have about the same amount of syntax I wouldn't agree, I feel Swift has significantly more surface area than Rust. But even syntax and standard libraries aside, I think that Rust is significantly more "explicit", "consistent" and "predictable" than Swift. I consider those to be very important qualities in a PL. Maybe that's why Rust was easier to learn and memorize than Swift (with the exception of the Rust borrow checker and lifetime annotations that indeed have to be well understood to be even usable). But it might be just me.
- dagmx 4y agoHmm can’t say I agree about the significantly more surface area. I switch between rust/C++/Swift fairly regularly for work, and I think they’re roughly similar in complexity with the exception of Rust having lifetime annotations and Swift having computer properties. Where I do think Swift has a lot of noise though is @attributes. There’s just so many attributes to learn, especially if you happen to do SwiftUI or ObjC interop. Though rust has the same issue , it’s just there’s no ubiquitous UI lib like SwiftUI. I imagine it would have the same if it did.