Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Making Swift Even More Functional (iOS Dev Camp DC)

mathonsunday
September 04, 2015
110

Making Swift Even More Functional (iOS Dev Camp DC)

Presented at iOS Dev Camp DC 2015

mathonsunday

September 04, 2015
Tweet

Transcript

  1. –The Recurse Center User’s Manual “Be rigorous. Understand how and

    why your code works. Understand your tools. If you're working with a framework (like Sinatra or Flask), learning to use it is just scratching the surface. Go deeper. Learn how it works.”
  2. – Functional Programming In Swift “Functional programmers emphasize that each

    program can be repeatedly broken into smaller and smaller pieces; all these pieces can be assembled using function application to define a complete program.”
  3. – Functional Programming In Swift “Functional programming… emphasizes the importance

    of programming with values, free of mutable state or other side effects.”
  4. vs

  5. •Optional makes is clear how to handle degenerate case •Code

    can live outside classes so easier to teach algorithmic reasoning before OOP
  6. •Named parameters make it easier to translate plain English into

    code •ARC means coders have to think about memory management, but not too much
  7. –RubyMonk “…the act of writing code that operates on code

    rather than on data. This involves inspecting and modifying a program as it runs using constructs exposed by the language.”
  8. •Every Swift apps execute inside the Objective-C runtime •Swift-only frameworks

    may lead to a Swift- only runtime OBJECTIVE-C RUNTIME
  9. vs

  10. STACK TRACE (fact 3) (fact-tail 3 1) (fact-tail 2 3)

    (fact-tail 1 6) (fact-tail 0 6) 6
  11. STACK TRACE (fact 3) (* 3 (fact 2)) (* 3

    (* 2 (fact 1))) (* 3 (* 2 (* 1 (fact 0)))) (* 3 (* 2 (* 1 1))) (* 3 (* 2 1))