SlideShare a Scribd company logo
1 of 30
Download to read offline
hipster oriented
programming
I hate monads already. Even if it’s
the most useful, elegant thing - it’s
all what’s wrong about hype based
hipster-programming in one word.
- tweet after UIKonf
Is it really functional
programming if you don't give a
talk about it?
- @alejandrocrosa
This talk is not about
functional programming.
orientation
Imperative
Do this 5 times!
func nullToNil(dict: [String: AnyObject])->[String: AnyObject]{
var cleaned = [String: AnyObject]()
for (key, value) in dict {
if !(value is NSNull) {
cleaned[key] = value
}
}
return cleaned
}
Functional
Same input, same output.
let l : List<Int> = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
let sum = l.reduce(curry(+), initial: 0) // 55
Functional Reactive
Stream of events being processed.
Functional Reactive
Stream of events being processed.
voiceSignal
.filter { response in
return response.intent == WitIntent.Eat
}
.bind(WitResponse.getSubject)
.map{ subject in
self.speak("I will search for recipies for (subject).")
return subject
}
.bind(RecipeSearch().search)
.map { recipes in
self.speak("Please select on of these recipies.")
return recipes
}
.bind(RecipePickerViewController().selectRecipe(self))
.map { ingredients in
self.speak("Do you have all the ingredients or should I order
some online for you?")
return ingredients
}
.bind(ShoppingList.selectIngredients(self))
.bind(Shopping.order)
.bind(PayPalViewController().checkout(self))
Object Oriented
Put your family of objects in a
room and let them talk.
Protocol Oriented
You have a lot of equatable,
comparable, parseable, archiveable,
transmittable, displayable objects.
Spaghetti Oriented
JSON parsing.
Question State How to recognise?
IP
imperative
How? a lot of nested loops and assignments
OOP
object oriented
How?
(but encapsulated)
encapsulated
state
seperation of concerns
“unix principle”
POP
protocol oriented
What? encapsulated
objects implementing hundreds
of protocols.
FP
functional
What? no state.
you have no idea what it’s doing,
but it’s short and beautiful.
FRP
functional reactive
When?
over my dead
lambda.
you’re constantly binding
They all mix pretty well.
- pretty big secret
bridging the worlds
Monads.
http://fuckingmonads.com
Signals.
jensravens.de/series/functional-reactive-programming-in-swift/
Boxing and Optionals.
Throwing Errors.
Mapping Arrays and
Collections.
Type Safety.
These are just concepts.
These are just concepts.
They won’t hurt you, they
won’t take away your job.
It’s more out there than just
object oriented
programming.
object oriented programming
has a lot of hidden gems you
might not be aware of yet.
What’s .next()?
Functors, Applicatives
and Monads in Pictures.
http://adit.io/posts/2013-04-17-
functors,_applicatives,_and_monads_in_pictures.html
The Introduction to RP
you’ve been missing.
https://gist.github.com/staltz/868e7e9bc2a7b8c1f754
Imperative Programming In Swift (Graham Lee)
sicpers.info/2015/07/imperative-programming-in-swift/
Protocol-Oriented Programming in Objective-C
sicpers.info/2015/06/protocol-oriented-programming-in-
objective-c/
Mutable objects in immutable objects in object-oriented
programming in functional programming in Swift
sicpers.info/2015/06/mutable-objects-in-immutable-
objects-in-object-oriented-programming-in-functional-
programming-in-swift/
Thank you.
@JensRavens
jensravens.de
(and be nice to the next monad you meet)

More Related Content

What's hot

LINQ Inside
LINQ InsideLINQ Inside
LINQ Inside
jeffz
 
JavaScript: Patterns, Part 3
JavaScript: Patterns, Part  3JavaScript: Patterns, Part  3
JavaScript: Patterns, Part 3
Chris Farrell
 
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
Nick Sieger
 

What's hot (20)

Introduction to Elm
Introduction to ElmIntroduction to Elm
Introduction to Elm
 
From Java to Kotlin - The first month in practice
From Java to Kotlin - The first month in practiceFrom Java to Kotlin - The first month in practice
From Java to Kotlin - The first month in practice
 
How much performance can you get out of Javascript? - Massimiliano Mantione -...
How much performance can you get out of Javascript? - Massimiliano Mantione -...How much performance can you get out of Javascript? - Massimiliano Mantione -...
How much performance can you get out of Javascript? - Massimiliano Mantione -...
 
JavaScript Basics
JavaScript BasicsJavaScript Basics
JavaScript Basics
 
Elm kyivfprog 2015
Elm kyivfprog 2015Elm kyivfprog 2015
Elm kyivfprog 2015
 
Voxxed Days Vilnius 2015 - Having fun with Javassist
Voxxed Days Vilnius 2015 - Having fun with JavassistVoxxed Days Vilnius 2015 - Having fun with Javassist
Voxxed Days Vilnius 2015 - Having fun with Javassist
 
to TRANSCLUDE or not to TRANSCLUDE
to TRANSCLUDE or not to TRANSCLUDEto TRANSCLUDE or not to TRANSCLUDE
to TRANSCLUDE or not to TRANSCLUDE
 
FRP
FRPFRP
FRP
 
You do not need automation engineer - Sqa Days - 2015 - EN
You do not need automation engineer  - Sqa Days - 2015 - ENYou do not need automation engineer  - Sqa Days - 2015 - EN
You do not need automation engineer - Sqa Days - 2015 - EN
 
Lambda Chops - Recipes for Simpler, More Expressive Code
Lambda Chops - Recipes for Simpler, More Expressive CodeLambda Chops - Recipes for Simpler, More Expressive Code
Lambda Chops - Recipes for Simpler, More Expressive Code
 
JavaScript in 2016
JavaScript in 2016JavaScript in 2016
JavaScript in 2016
 
JS Fest 2018. Сергей Пузанков. E2E-тестирование фронтенда c Hermione
JS Fest 2018. Сергей Пузанков. E2E-тестирование фронтенда c HermioneJS Fest 2018. Сергей Пузанков. E2E-тестирование фронтенда c Hermione
JS Fest 2018. Сергей Пузанков. E2E-тестирование фронтенда c Hermione
 
Avoiding Callback Hell with Async.js
Avoiding Callback Hell with Async.jsAvoiding Callback Hell with Async.js
Avoiding Callback Hell with Async.js
 
LINQ Inside
LINQ InsideLINQ Inside
LINQ Inside
 
JavaScript: Patterns, Part 3
JavaScript: Patterns, Part  3JavaScript: Patterns, Part  3
JavaScript: Patterns, Part 3
 
An Introduction to Reactive Cocoa
An Introduction to Reactive CocoaAn Introduction to Reactive Cocoa
An Introduction to Reactive Cocoa
 
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
 
JavaScript for Web Analysts
JavaScript for Web AnalystsJavaScript for Web Analysts
JavaScript for Web Analysts
 
Elm @ DublinJS
Elm @ DublinJSElm @ DublinJS
Elm @ DublinJS
 
ELI5: What the heck is a Functor?
ELI5: What the heck is a Functor?ELI5: What the heck is a Functor?
ELI5: What the heck is a Functor?
 

Viewers also liked

Viewers also liked (7)

Media evaluation 5
Media evaluation 5Media evaluation 5
Media evaluation 5
 
Hipster
HipsterHipster
Hipster
 
Urban Tribes-Hipsters
Urban Tribes-HipstersUrban Tribes-Hipsters
Urban Tribes-Hipsters
 
Hipster Infographic
Hipster InfographicHipster Infographic
Hipster Infographic
 
Tribu Urbana "Hipster"
Tribu Urbana "Hipster"Tribu Urbana "Hipster"
Tribu Urbana "Hipster"
 
Hipster ppt
Hipster pptHipster ppt
Hipster ppt
 
Hipsters
HipstersHipsters
Hipsters
 

Similar to Hipster Oriented Programming

Functional OO programming (as part of the the PTT lecture)
Functional OO programming (as part of the the PTT lecture)Functional OO programming (as part of the the PTT lecture)
Functional OO programming (as part of the the PTT lecture)
Ralf Laemmel
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
tswr
 

Similar to Hipster Oriented Programming (20)

Functional programming is the most extreme programming
Functional programming is the most extreme programmingFunctional programming is the most extreme programming
Functional programming is the most extreme programming
 
All of Javascript
All of JavascriptAll of Javascript
All of Javascript
 
LISP: How I Learned To Stop Worrying And Love Parantheses
LISP: How I Learned To Stop Worrying And Love ParanthesesLISP: How I Learned To Stop Worrying And Love Parantheses
LISP: How I Learned To Stop Worrying And Love Parantheses
 
Fp for the oo programmer
Fp for the oo programmerFp for the oo programmer
Fp for the oo programmer
 
Object-Oriented Programming in Java (Module 1)
Object-Oriented Programming in Java (Module 1)Object-Oriented Programming in Java (Module 1)
Object-Oriented Programming in Java (Module 1)
 
Metaprogramming JavaScript
Metaprogramming  JavaScriptMetaprogramming  JavaScript
Metaprogramming JavaScript
 
Functional Programming and Big Data
Functional Programming and Big DataFunctional Programming and Big Data
Functional Programming and Big Data
 
ScalaDays 2013 Keynote Speech by Martin Odersky
ScalaDays 2013 Keynote Speech by Martin OderskyScalaDays 2013 Keynote Speech by Martin Odersky
ScalaDays 2013 Keynote Speech by Martin Odersky
 
Principled io in_scala_2019_distribution
Principled io in_scala_2019_distributionPrincipled io in_scala_2019_distribution
Principled io in_scala_2019_distribution
 
Functional OO programming (as part of the the PTT lecture)
Functional OO programming (as part of the the PTT lecture)Functional OO programming (as part of the the PTT lecture)
Functional OO programming (as part of the the PTT lecture)
 
Functional Programming in PHP
Functional Programming in PHPFunctional Programming in PHP
Functional Programming in PHP
 
Monad Fact #6
Monad Fact #6Monad Fact #6
Monad Fact #6
 
C# .NET - Um overview da linguagem
C# .NET - Um overview da linguagem C# .NET - Um overview da linguagem
C# .NET - Um overview da linguagem
 
PRESENTATION ON PYTHON.pptx
PRESENTATION ON PYTHON.pptxPRESENTATION ON PYTHON.pptx
PRESENTATION ON PYTHON.pptx
 
The State of #NLProc
The State of #NLProcThe State of #NLProc
The State of #NLProc
 
Presentation
PresentationPresentation
Presentation
 
Pharo: A Reflective System
Pharo: A Reflective SystemPharo: A Reflective System
Pharo: A Reflective System
 
All of javascript
All of javascriptAll of javascript
All of javascript
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
 
Go Beyond Higher Order Functions: A Journey into Functional Programming
Go Beyond Higher Order Functions: A Journey into Functional ProgrammingGo Beyond Higher Order Functions: A Journey into Functional Programming
Go Beyond Higher Order Functions: A Journey into Functional Programming
 

More from Jens Ravens

More from Jens Ravens (8)

Turning it up to 11 - Scaling Ruby on Rails to 100k rps
Turning it up to 11 - Scaling Ruby on Rails to 100k rpsTurning it up to 11 - Scaling Ruby on Rails to 100k rps
Turning it up to 11 - Scaling Ruby on Rails to 100k rps
 
Server Side Swift - AppBuilders 2017
Server Side Swift - AppBuilders 2017Server Side Swift - AppBuilders 2017
Server Side Swift - AppBuilders 2017
 
Server Side Swift
Server Side SwiftServer Side Swift
Server Side Swift
 
Working with Xcode and Swift Package Manager
Working with Xcode and Swift Package ManagerWorking with Xcode and Swift Package Manager
Working with Xcode and Swift Package Manager
 
Server Side Swift with Swag
Server Side Swift with SwagServer Side Swift with Swag
Server Side Swift with Swag
 
Taming Asynchronous Transforms with Interstellar
Taming Asynchronous Transforms with InterstellarTaming Asynchronous Transforms with Interstellar
Taming Asynchronous Transforms with Interstellar
 
Swift 2
Swift 2Swift 2
Swift 2
 
Swift: Immutability and You
Swift: Immutability and YouSwift: Immutability and You
Swift: Immutability and You
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

Hipster Oriented Programming