Making it Generic
summary
Shows how generics cut a linear explosion of types in a Swift iOS app for a Glowforge 3D laser printer by replacing repeated code with one polymorphic implementation. Demonstrates concrete examples: a custom map implementation, a generic Stack<Element>, JSON parsing using Codable and a generic APIRequest that decodes network responses, and handling socket updates via resource identifier specialization. Result: fewer duplicated types, single unified code paths, and working runtime decoding from generic descriptors into concrete models.
AI-written summary · about
chapters (16)
- 0:00Start
- 1:10GENERICS: ABSTRACTION & SPECIALIZATION
- 1:40GENERICS: FLEXIBILITY
- 2:07GENERICS: TYPES
- 2:27GENERICS BY VALUE: ASCII ART
- 5:47MAP: FLEXIBLE AND SAFE
- 6:30GENERICS BY TYPE: STACK
- 6:47GENERICS BY TYPE: EMOJI STACK
- 7:03GENERICS BY TYPE: INT STACK
- 8:58JSON & GENERICS
- 9:10GENERICS: JSON API
- 10:29DATA: RESOURCE PACKET
- 11:45NETWORK CALL
- 12:27OBJECT MANAGER
- 12:44SOCKET MESSAGE RECEIVED
- 14:02TAKE AWAY








