3 ms·
Swift borrows some ideas from C#, along with Kotlin, ObjC, and others. It's also radically different from C#: 1. Swift collections and strings are value types,
by millstone 11y ago
Swift borrows some ideas from C#, along with Kotlin, ObjC, and others. It's also radically different from C#:
1. Swift collections and strings are value types, but in C# they are reference types
2. Swift strings are mutable, C# strings are not
3. C# by default allows reference types to be nil, Swift does not
4. Swift performs overflow checking by default, C# does not
5. Swift is reference counted, C# is GCed
6. Swift's inouts are very different from C#'s ref. For example, Swift's inouts support properties
7. Swift's error handling is quite different from C#'s exceptions, both in syntax and implementation
8. Swift's enums act as algebraic data types, C# has nothing like this
9. Swift's switch statements are much more flexible than C#, because of where clauses
and more.
These are some radical departures! The differences between Swift and C# are much greater than the differences between C# and Java.
- peterashford 11y agoThat sounds really trivial to me. You've described less difference between Swift and C# than exists between C# and Java and those latter languages are commonly thought to bew very similar.