3 ms·
Very subjective, I for one like practically everything you listed as not liking about the syntax: > I hate let, var, func For me it increases readability, for
by AsyncAwait 9y ago
Very subjective, I for one like practically everything you listed as not liking about the syntax:
> I hate let, var, func
For me it increases readability, for example when I see let, I can make assumptions about it not being mutated, which is a huge win in a large codebase.
> I hate the backwards variable definitions.
To me it says, "this is a variable called x of type String", which seems to make sense to me, definitely more so that the C way.
I hate the crazy punctionation symbols (dots, question marks).
Question marks denoting optionals seems very clear, like "is String? really there?"
> I find Objective-C beautiful and Swift ugly.
See, I am the other way, I don't really find [[]] all that beautiful.
- fauigerzigerk 9y ago>when I see let, I can make assumptions about it not being mutated, which is a huge win in a large codebase. What we know is that this won't work: let p = Person("one") p = Person("two") But we don't know whether this will work: p.name = "three" It depends on whether Person is a struct or a class, but that information is not available locally. let/var is fine, but in terms of information content it is strictly worse than what const can do in C.
- AsyncAwait 9y agoYou're right, if reference types are involved, it becomes tricky, however to the extent that Swift encourages value types, it still provides value. > in terms of information content it is strictly worse than what const can do in C. True, however the Swift community largely adopted a "use let first, only use var if absolutely necessary" approach, which is strictly better in terms of mutability-related bugs than what it was in ObjC/C, as mutability there is used much more liberally than in Swift.