| One thing I never understood about Swift and that I don't think is addressed in Swift 3 is the widespread inconsistency with simple 'if' statements. There are at least three incompatible ways to think about 'if' syntax in Swift: if foo == 1 && bar ==2
//normal, from other languages if let somevar = foo, let anothervar = bar
//note, must use a comma rather than && if case .someEnum = foobar
//cannot use == ! That latter would be much easier to think about like foobar == .someEnum but it gets mucked up. I don't understand why these can't be streamlined into something like this: if let a = b && let d == f && foobar == .someEnum
//you can't do any of this Instead, you have to use "where" and commas rather than && in some places, the whole thing is a much greater cognitive overload than it should be for such a fundamental task in any language. |