6 ms·
> Swift on the other had is a language where wonks decided to throw every silly feature they thought off to the point that is becoming more complex than even Sc
by teakettle42 4y ago
> Swift on the other had is a language where wonks decided to throw every silly feature they thought off to the point that is becoming more complex than even Scala.
What features in particular do you think represent unjustified complexity?
Swift is not my favorite, but I wouldn’t consider it to be a “kitchen-sink” language, and it’s certainly less complicated than Scala.
- astrange 4y ago"guard" is kind of useless but it's minor.
- zapzupnz 4y ago`guard` has its time and place, which is to refactor pyramids of doom away. The number of nested `if let` statements I've seen, and written, is upsetting.
- astrange 4y agoPerl's "unless" syntax, or allowing "if"s at the end of a statement, also solve this and are more flexible.
- zapzupnz 4y agoI don't think they quite address the same thing. `guard` isn't just an `if` statement that looks for the negative of a Boolean; it also forces handing control flow out of scope in a consistent way — you cannot write a `guard` statement without also deciding how you'll exit the scope if the Boolean is false. The developer not being made to do so, and just embedding conditions within conditions, is how the pyramids of doom are constructed to begin with.