Slide 1

Slide 1 text

the$f&t&re$of Ash Furrow functional programming on$iOS

Slide 2

Slide 2 text

Objective-C

Slide 3

Slide 3 text

Objective- C

Slide 4

Slide 4 text

Closures Functional patterns Concise syntax Native Collections Operator overloading Namespaces Tuples Clear mutability syntax Interactive playground Multiple return types Generics Protocols and extensions on structs Pattern matching Fast iteration Optional types Object orientation Type inference Read-Eval-Print-Loop (REPL) Compile to native code

Slide 5

Slide 5 text

Closures Functional patterns Concise syntax Native Collections Operator overloading Namespaces Tuples Clear mutability syntax Interactive playground Multiple return types Generics Protocols and extensions on structs Pattern matching Fast iteration Optional types Object orientation Type inference Read-Eval-Print-Loop (REPL) Compile to native code

Slide 6

Slide 6 text

Closures Functional patterns Concise syntax Native Collections Operator overloading Namespaces Tuples Clear mutability syntax Interactive playground Multiple return types Generics Protocols and extensions on structs Pattern matching Fast iteration Optional types Object orientation Type inference Read-Eval-Print-Loop (REPL) Compile to native code

Slide 7

Slide 7 text

Objective-C

Slide 8

Slide 8 text

Objective- C

Slide 9

Slide 9 text

Objective-C

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

It will not be we make apps for the WATCH 5 and the other future iOS devices. It will be a group of developers very much like us. But with more of our strengths and fewer of our weaknesses. More confident, far-seeing, and capable of using functional paradigms. For all of our failings, despite our limitations and fallibilities, we developers are capable of greatness. —Carl Sagan

Slide 12

Slide 12 text

1. Imperative$prog5amming$is$old$and$busted$ 2.Functional$prog5amming$is$the$new$ho?@ess$ 3.Ge?ing$starCed$with$f&nctional$prog5amming$in$Swiſt$is$superEeasy

Slide 13

Slide 13 text

old and busted

Slide 14

Slide 14 text

BNE ADD1 BRA NONE1 ADD1 INY ;increment our counter of 1's NONE1 LDAA TEMP ;reload accumulator A LSL MASK ;Shift the mask's 1 bit left BNE LOOP1 ;If we haven't finished our loop, branch LDAA #$01 ;load new mask into A STAA MASK ;store the reset mask into MASK TSX ;pull of return address and store in X PULA ;pull off A STAA TEMP ;store the value into temp TXS ;push return address back onto the stack LOOP2 LDAA TEMP ;Load A into TEMP ANDA MASK ;logical AND MASK with A BNE ADD2 ;add one if we need to BRA NONE2 ADD2 INY ;increment our counter of 1's NONE2 LDAA TEMP LSL MASK ;shift our mask left by one BNE LOOP2 ;loop back until we've exhausted positions

Slide 15

Slide 15 text

new hottness

Slide 16

Slide 16 text

functional programming • It’s been around forever • But only in universities (ew)

Slide 17

Slide 17 text

what is functional programming? • Treat computation as the result of functions • Avoid mutable state and data

Slide 18

Slide 18 text

f&nctional$prog5amming$tells$the$computer instead$of what to do how to do it

Slide 19

Slide 19 text

getting started is super-fácil* *ed:$Spanish

Slide 20

Slide 20 text

code let’s

Slide 21

Slide 21 text

github.com/ashfurrow/nsspain2014 [~]

Slide 22

Slide 22 text

resources • Books • GitHub • ReactiveCocoa • swiftz • Stack Overflow • Tweet me

Slide 23

Slide 23 text

objc.io/books

Slide 24

Slide 24 text

github.com/artsy/eidolon

Slide 25

Slide 25 text

1. Imperative$prog5amming$is$old$and$busted$ 2.Functional$prog5amming$is$the$new$ho?@ess$ 3.Ge?ing$starCed$with$f&nctional$prog5amming$in$Swiſt$is$superEeasy

Slide 26

Slide 26 text

so where now? • Swift promised functional patterns • Failed to deliver • Community is picking up the slack

Slide 27

Slide 27 text

make better mistakes tomorrow

Slide 28

Slide 28 text

gracias @ashfurrow