Practical Declarative Programming
summary
Claim: declarative Swift code (map/filter/reduce, higher‑order functions, currying) replaces multi‑line mutation with single‑line transforms, improves readability and testability, and in a microbenchmark map is faster by about two seconds over a million runs. Uses: Swift 2.0 standard library, QueryKit for type‑safe Core Data queries, NSPredicate/SQL and regex as DSL examples. Built: converters that parse newline/comma input, flatten and sort groups, and type‑safe core‑data queries — all reduced to concise expressions that work and remove mutation.
AI-written summary · about
chapters (23)
- 0:00Practical Declarative Programming
- 0:24Imperative Programming
- 0:39Describe how to achieve something
- 0:52Describe what to do. Not how to do it.
- 1:11Implementation Details
- 1:45How can we do declarative programming?
- 2:06Constraints
- 2:25Regular expressions
- 6:50What makes up functional programming?
- 7:09Side-effects
- 7:19What is not functional function?
- 8:23High Order Functions
- 8:47Everything is a function
- 10:38Callables in Swift
- 11:41Interchangeability
- 12:44Functional programming by Example
- 15:46Order the numbers of people in each group
- 16:59Operators are functions
- 17:17Building an array of all people
- 22:18Why are map and reduce better?
- 22:32Immutability
- 22:48Performance
- 23:39Don't iterate over arrays
related talks
48mRefactoring from Good to Great - A Live-Coding Odyssey
36mLet’s make your DATA sexy
38mTesting and Declarative UI's
32mFive Lines of Code
16mEffective Strategies for Testing and Releasing Server Side Changes
29mCodemods: Refactoring JavaScript using JavaScript
34mScripting in Swift For a Testable Build
33mWhat people get wrong about testing and how can you leverage tests to develop a lot faster!
