Why Swift would be a better choice for the next production app.
- correctness at compile time (besides behavior)
- types as proofs (... illegal is impossible)
- vs. testing
- Examples
Optional
(Maybe
), typed collections
- steep ramp-up, but compiles == runs well
- class declaration
- blocks/closures
- less code
- initializers
- string interpolation
- (basic) operator overloading
- literals
- no .h/.m (not really private)
- first-class primitives
- stdlib includes
map
,flatMap
,reduce
- currying
- (most) type inference
- (somewhat) lazy
- enums, structs
- a great complement for functional programming
- avoid state (functional core, imperative shell)
- Immutable by default, single owner
- thread safety
Current performance is in-par with C++
Look out for:
- optimization setting
- separate frameworks (with whole module optimization)
final
- https://realm.io/news/swift-summit-joseph-lord-performance/
- https://developer.apple.com/swift/blog/?id=27
- http://www.primatelabs.com/blog/2015/02/swift-performance-updated/
- namespaces
- property observers
- generics
- tuples
- operator overloading
- dynamic frameworks
- versioned; reduced app size; can include assets etc.
- playgrounds
- well designed from scratch (rather than a legacy system)
- developer mindshare
- May have rough edges (very few post-2.0)
- Some tasks are more difficult with the strong type system (parsing JSON, building a plugin system)
- Interacting with C (lots better in 2.0)
- Familiar vs. complex
- Solutions can be too Creative ✨
- New...