Wednesday, November 7, 2018

Server-side Swift: Making Canopy

Max Howell:

Swift is not the best language at everything, but it is the best set of trade-offs that make it the best language overall for anything (it supports) right now. Since it was announced the clear and careful design decisions of Swift-Core have impressed me enough to commit to it entirely. I have programmed in many, many languages and often find that the language and its standard library are inconsistently good, Team-Swift give a damn about their language and its standard library at a level beyond anything else out there.

[…]

Intrinsic type-safety cross-process with barely any work from me was super comfy and made the 1,000 miles between me and my server seem no different to passing data between view-controllers.

However the lack of dynamism means even adding a single parameter to these structs means versioning my endpoints or making new parameters Optional. It’s not all roses, but frankly, versioning has worked well and means my code for interpreting incoming data is not a logic bomb of if-statements, it is carefully, separately encapsulated and tested, type-safe endpoints.

Previously: When JSONDecoder Meets the Real World, Swift.Codable, Swift 4: JSON With Encoder and Encodable.

Comments RSS · Twitter

Leave a Comment