SlideShare uma empresa Scribd logo
1 de 25
Into the Land of Lambda 
(into functional-programming (one 
(programmers-journey)))
Who am I? 
Currently, a programmer @livingsocial 
Previously a software consultant at various Fortune 1000 companies, including 
banking, pharma, and transportation sectors 
Lots of work with start-ups since 2005 
Speaker at first Rails Conf (‘06), Ruby Conf 
(‘08) 
Sarasota resident since ‘96  
mike.pence@livingsocial.com 
@mikepence
The context of my experience… 
Tools I have known and loved (starting out)
The context of my experience… 
Tools I have known and loved (oy! the 90’s!) 
You had to re-invent yourself every 2 years 
The context of my experience… 
True love since ’05 (well, love/hate with Rails)
~25 years of OOP (for me) 
How come it isn’t getting any easier?
Our relationship with objects 
It’s complicated 
• Graphs (trees) of objects maintain 
internal state at every level in the 
call stack 
• Bugs are the product of 
programmatic logic + the transient 
state of the world at the time of the 
error 
• Example-based unit or integration 
tests are of limited usefulness (they 
prove their example case, but 
nothing more) 
• No guarantee that calling the same 
method with the same arguments 
will return the same result (aka 
referential transparency) because 
variables
Reasoning about objects 
Feels Like A Shell Game
Attempts to make OOP better 
Each with their own trade-offs… 
• Dependency injection / AOP 
• Following SOLID design principles 
• Single Responsibility Principle 
• Liskov Substitution Principle 
• Etc. 
• Hexagonal Architecture 
• Ports and Adapters 
• Pipes and Filters 
Still the fundamental problem remains that 
state is casually managed, if managed at all. 
Nevermind concurrency!
This Talk Gets Its Own Slide 
“Are we there yet?” 
http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey 
The conflation of behavior, 
state, identity and time is a big 
source of implicit complexity in 
current object systems. 
We should primarily be 
programming with pure 
functions and immutable 
values. 
- Rich Hickey
Is There a Different Way? 
(Spoiler alert: There is!)
Another way 
Disambiguating identity, value, time and mutation
Statefulness, YAGNI 
Avoid it most of the time. Manage it when you need it. 
• 99% of the time, you don’t need internal state in functions / methods 
• As an exercise, try passing in variables and having mutated values returned in 
<language you use daily> 
• But Clojure is not about avoiding state, it is about managing it with well-defined 
semantics 
• To re-iterate, identity is a sequence of states 
• America is an identity 
• The PIC (prez, vice prez) are transient
A couple more analogies 
State is like garbage, or Buddhism (which is not) 
• Clojure provides "managed time" in much the same way that GC's have come to 
provide managed memory 
• * My team at LS offered a lot of this content 
• They say Buddhists with advanced training don't see a "video" through their eyes, 
but something like a series of pictures, like a flip book 
• This "epochal state model" concept is similar, differs in that there are multiple 
perceivers observing/looking at many flowing identities
Code Examples 
Let’s See Some!
Some Code Samples 
Here they are! 
• http://nakkaya.com/2009/10/04/fractals-in-clojure-buddhabrot-fractal/ 
• http://wicketconsole.appspot.com/clojureWithTemplates 
• http://www.slideshare.net/alexmiller/clojure-the-art-of-abstraction-7161663
A Whole New World 
Full of win!
Clojure / FP Wins 
Reliability 
• Code is “provable” because it lacks transient variables 
– Tests pass in all required state 
– Example-based (unit) tests are great 
• Generative tests are better 
• Stepping debuggers and similar approaches to diagnosing functions with variables 
are simply not needed (but are available). 
• My experience so far has been that a whole class of bugs simply don’t occur
Clojure / FP Wins 
Focus 
• You focus on a small set of hierarchical data structures and the functions that 
process them 
– Visualize any JSON nested structure you have seen 
• Biggest take-away for me 
– You simply don’t need all of the ceremony of OOP 
"It is better to have 100 functions operate on one data structure than 10 functions on 
10 data structures." — Alan Perlis
Clojure / FP Wins 
Expressivity and elegance 
• Your functions and the built-in functions, or library functions, are syntactical peers 
• So no awkwardly implemented DSL’s 
• No odd, arbitrary-seeming mix of infix, postfix and dot notation 
• It is functions, all the way down 
• So you can freely build your own vocabulary of functions to model your problem 
domain and solution 
• Which I am really excited to see in practice 
• Also, macros!
Clojure / FP Wins 
Access to awesome libraries and community 
https://github.com/trending?l=clojure&since=weekly
Clojure / FP Wins 
More 
• Concurrent and performant 
• On the JVM 
• With all the goodness that brings 
• Used by LivingSocial for their massive email processing needs 
• Plays well with Java 
• But not just for Java! 
• CLR version 
• Enables Unity3D and Unreal Engine programming! 
• JavaScript version 
• ClojureScript 
• A whole awesome thing in its own right 
• Port of Clojure’s immutable data structure libraries included 
• Om and React.js, OMG! 
• You could program for tablets, consoles, phones, etc. 
• LightTable!
Adorable!
Thank you! 
For Your Participation
Questions and Discussion 
This subheading intentionally left blank

Mais conteúdo relacionado

Mais procurados

Startup Architecture: How to Lean on Others to Get Stuff DoneUntitled
Startup Architecture: How to Lean on Others to Get Stuff DoneUntitledStartup Architecture: How to Lean on Others to Get Stuff DoneUntitled
Startup Architecture: How to Lean on Others to Get Stuff DoneUntitledC4Media
 
Noam Kfir - There is no Java Script - code.talks 2015
Noam Kfir - There is no Java Script - code.talks 2015Noam Kfir - There is no Java Script - code.talks 2015
Noam Kfir - There is no Java Script - code.talks 2015AboutYouGmbH
 
PHP Frameworks Review - Mar 19 2015
PHP Frameworks Review - Mar 19 2015PHP Frameworks Review - Mar 19 2015
PHP Frameworks Review - Mar 19 2015kyphpug
 
JOSA TechTalks - Compilers, Transpilers, and Why You Should Care
JOSA TechTalks - Compilers, Transpilers, and Why You Should CareJOSA TechTalks - Compilers, Transpilers, and Why You Should Care
JOSA TechTalks - Compilers, Transpilers, and Why You Should CareJordan Open Source Association
 
From Imperative to Functional Programming (for Absolute Beginners)
From Imperative to Functional Programming (for Absolute Beginners)From Imperative to Functional Programming (for Absolute Beginners)
From Imperative to Functional Programming (for Absolute Beginners)Alex Bunardzic
 
Rethinking Scala Presented in San Francisco May 7, 2014
Rethinking Scala Presented in San Francisco May 7, 2014Rethinking Scala Presented in San Francisco May 7, 2014
Rethinking Scala Presented in San Francisco May 7, 2014Bruce Eckel
 
Introducing the Ceylon Project
Introducing the Ceylon ProjectIntroducing the Ceylon Project
Introducing the Ceylon ProjectMichael Scovetta
 
CatalystX::SimpleLogin
CatalystX::SimpleLoginCatalystX::SimpleLogin
CatalystX::SimpleLoginTomas Doran
 
Modern js in practice
Modern js in practiceModern js in practice
Modern js in practicefesuffolk
 
Akka.NET: Concurrency Without the Pain (Intro to the Actor Model)
Akka.NET: Concurrency Without the Pain (Intro to the Actor Model)Akka.NET: Concurrency Without the Pain (Intro to the Actor Model)
Akka.NET: Concurrency Without the Pain (Intro to the Actor Model)petabridge
 
Emergent design @ Pronto 24/11/2013
Emergent design @ Pronto 24/11/2013Emergent design @ Pronto 24/11/2013
Emergent design @ Pronto 24/11/2013Varokas Panusuwan
 
Keynote, PNW Scala 2013
Keynote, PNW Scala 2013Keynote, PNW Scala 2013
Keynote, PNW Scala 2013Paul Phillips
 
LF_APIStrat17_Don't Repeat Yourself - Your API is Your Documentation
LF_APIStrat17_Don't Repeat Yourself - Your API is Your DocumentationLF_APIStrat17_Don't Repeat Yourself - Your API is Your Documentation
LF_APIStrat17_Don't Repeat Yourself - Your API is Your DocumentationLF_APIStrat
 
We’re Going Mobile! Great! Wait… What Does That Mean?
We’re Going Mobile! Great! Wait… What Does That Mean?We’re Going Mobile! Great! Wait… What Does That Mean?
We’re Going Mobile! Great! Wait… What Does That Mean?STC-Philadelphia Metro Chapter
 
Keynote, LambdaConf 2014 - The Silent Productivity Killer
Keynote, LambdaConf 2014 - The Silent Productivity KillerKeynote, LambdaConf 2014 - The Silent Productivity Killer
Keynote, LambdaConf 2014 - The Silent Productivity KillerPaul Phillips
 
Sql server baselines
Sql server baselinesSql server baselines
Sql server baselinesMike Walsh
 

Mais procurados (20)

Actors drammen
Actors drammenActors drammen
Actors drammen
 
Startup Architecture: How to Lean on Others to Get Stuff DoneUntitled
Startup Architecture: How to Lean on Others to Get Stuff DoneUntitledStartup Architecture: How to Lean on Others to Get Stuff DoneUntitled
Startup Architecture: How to Lean on Others to Get Stuff DoneUntitled
 
Noam Kfir - There is no Java Script - code.talks 2015
Noam Kfir - There is no Java Script - code.talks 2015Noam Kfir - There is no Java Script - code.talks 2015
Noam Kfir - There is no Java Script - code.talks 2015
 
PHP Frameworks Review - Mar 19 2015
PHP Frameworks Review - Mar 19 2015PHP Frameworks Review - Mar 19 2015
PHP Frameworks Review - Mar 19 2015
 
JOSA TechTalks - Compilers, Transpilers, and Why You Should Care
JOSA TechTalks - Compilers, Transpilers, and Why You Should CareJOSA TechTalks - Compilers, Transpilers, and Why You Should Care
JOSA TechTalks - Compilers, Transpilers, and Why You Should Care
 
From Imperative to Functional Programming (for Absolute Beginners)
From Imperative to Functional Programming (for Absolute Beginners)From Imperative to Functional Programming (for Absolute Beginners)
From Imperative to Functional Programming (for Absolute Beginners)
 
Rethinking Scala Presented in San Francisco May 7, 2014
Rethinking Scala Presented in San Francisco May 7, 2014Rethinking Scala Presented in San Francisco May 7, 2014
Rethinking Scala Presented in San Francisco May 7, 2014
 
Introducing the Ceylon Project
Introducing the Ceylon ProjectIntroducing the Ceylon Project
Introducing the Ceylon Project
 
CatalystX::SimpleLogin
CatalystX::SimpleLoginCatalystX::SimpleLogin
CatalystX::SimpleLogin
 
OOP in JS
OOP in JSOOP in JS
OOP in JS
 
Modern js in practice
Modern js in practiceModern js in practice
Modern js in practice
 
Akka.NET: Concurrency Without the Pain (Intro to the Actor Model)
Akka.NET: Concurrency Without the Pain (Intro to the Actor Model)Akka.NET: Concurrency Without the Pain (Intro to the Actor Model)
Akka.NET: Concurrency Without the Pain (Intro to the Actor Model)
 
Emergent design @ Pronto 24/11/2013
Emergent design @ Pronto 24/11/2013Emergent design @ Pronto 24/11/2013
Emergent design @ Pronto 24/11/2013
 
Keynote, PNW Scala 2013
Keynote, PNW Scala 2013Keynote, PNW Scala 2013
Keynote, PNW Scala 2013
 
Scalable game-servers-tgc
Scalable game-servers-tgcScalable game-servers-tgc
Scalable game-servers-tgc
 
LF_APIStrat17_Don't Repeat Yourself - Your API is Your Documentation
LF_APIStrat17_Don't Repeat Yourself - Your API is Your DocumentationLF_APIStrat17_Don't Repeat Yourself - Your API is Your Documentation
LF_APIStrat17_Don't Repeat Yourself - Your API is Your Documentation
 
We’re Going Mobile! Great! Wait… What Does That Mean?
We’re Going Mobile! Great! Wait… What Does That Mean?We’re Going Mobile! Great! Wait… What Does That Mean?
We’re Going Mobile! Great! Wait… What Does That Mean?
 
Keynote, LambdaConf 2014 - The Silent Productivity Killer
Keynote, LambdaConf 2014 - The Silent Productivity KillerKeynote, LambdaConf 2014 - The Silent Productivity Killer
Keynote, LambdaConf 2014 - The Silent Productivity Killer
 
Sql server baselines
Sql server baselinesSql server baselines
Sql server baselines
 
scala-intro
scala-introscala-intro
scala-intro
 

Destaque

React. Flux. Redux. by Andrey Kolodnitskiy
React. Flux. Redux. by Andrey KolodnitskiyReact. Flux. Redux. by Andrey Kolodnitskiy
React. Flux. Redux. by Andrey KolodnitskiyValeriia Maliarenko
 
Understanding Redux — Ilya Gelman
Understanding Redux — Ilya GelmanUnderstanding Redux — Ilya Gelman
Understanding Redux — Ilya Gelman500Tech
 
Application architecture doesn't have to suck
Application architecture doesn't have to suckApplication architecture doesn't have to suck
Application architecture doesn't have to suckjtregunna
 
Dumb and smart components + redux (1)
Dumb and smart components + redux (1)Dumb and smart components + redux (1)
Dumb and smart components + redux (1)Brecht Billiet
 
'Did He Really Say That?" effective component communication
'Did He Really Say That?" effective component communication'Did He Really Say That?" effective component communication
'Did He Really Say That?" effective component communicationGus Sabatino
 
Angular 2 Component Communication - Talk by Rob McDiarmid
Angular 2 Component Communication - Talk by Rob McDiarmidAngular 2 Component Communication - Talk by Rob McDiarmid
Angular 2 Component Communication - Talk by Rob McDiarmidAmrita Chopra
 
RxJS + Redux + React = Amazing
RxJS + Redux + React = AmazingRxJS + Redux + React = Amazing
RxJS + Redux + React = AmazingJay Phelps
 
React + Redux Introduction
React + Redux IntroductionReact + Redux Introduction
React + Redux IntroductionNikolaus Graf
 
Are we there yet?
Are we there yet?Are we there yet?
Are we there yet?UCD Library
 

Destaque (11)

React. Flux. Redux. by Andrey Kolodnitskiy
React. Flux. Redux. by Andrey KolodnitskiyReact. Flux. Redux. by Andrey Kolodnitskiy
React. Flux. Redux. by Andrey Kolodnitskiy
 
Understanding Redux — Ilya Gelman
Understanding Redux — Ilya GelmanUnderstanding Redux — Ilya Gelman
Understanding Redux — Ilya Gelman
 
Application architecture doesn't have to suck
Application architecture doesn't have to suckApplication architecture doesn't have to suck
Application architecture doesn't have to suck
 
Dumb and smart components + redux (1)
Dumb and smart components + redux (1)Dumb and smart components + redux (1)
Dumb and smart components + redux (1)
 
'Did He Really Say That?" effective component communication
'Did He Really Say That?" effective component communication'Did He Really Say That?" effective component communication
'Did He Really Say That?" effective component communication
 
React. Flux. Redux
React. Flux. ReduxReact. Flux. Redux
React. Flux. Redux
 
Angular 2 Component Communication - Talk by Rob McDiarmid
Angular 2 Component Communication - Talk by Rob McDiarmidAngular 2 Component Communication - Talk by Rob McDiarmid
Angular 2 Component Communication - Talk by Rob McDiarmid
 
Simple made easy
Simple made easySimple made easy
Simple made easy
 
RxJS + Redux + React = Amazing
RxJS + Redux + React = AmazingRxJS + Redux + React = Amazing
RxJS + Redux + React = Amazing
 
React + Redux Introduction
React + Redux IntroductionReact + Redux Introduction
React + Redux Introduction
 
Are we there yet?
Are we there yet?Are we there yet?
Are we there yet?
 

Semelhante a Into the Land of lambda, One Programmer's Journey Into Functional Programming

The Ideas of Clojure - Things I learn from Clojure
The Ideas of Clojure - Things I learn from ClojureThe Ideas of Clojure - Things I learn from Clojure
The Ideas of Clojure - Things I learn from ClojureHsuan Fu Lien
 
Generalization in Auto-Testing. How we put what we had into new Technological...
Generalization in Auto-Testing. How we put what we had into new Technological...Generalization in Auto-Testing. How we put what we had into new Technological...
Generalization in Auto-Testing. How we put what we had into new Technological...SQALab
 
Clojure in real life 17.10.2014
Clojure in real life 17.10.2014Clojure in real life 17.10.2014
Clojure in real life 17.10.2014Metosin Oy
 
Java Closures
Java ClosuresJava Closures
Java ClosuresBen Evans
 
The Economies of Scaling Software
The Economies of Scaling SoftwareThe Economies of Scaling Software
The Economies of Scaling SoftwareAbdelmonaim Remani
 
C# .NET - Um overview da linguagem
C# .NET - Um overview da linguagem C# .NET - Um overview da linguagem
C# .NET - Um overview da linguagem Claudson Oliveira
 
The economies of scaling software - Abdel Remani
The economies of scaling software - Abdel RemaniThe economies of scaling software - Abdel Remani
The economies of scaling software - Abdel Remanijaxconf
 
Introduction to Clojure
Introduction to ClojureIntroduction to Clojure
Introduction to ClojureRenzo Borgatti
 
Take your CFML Legacy Apps to Modernization
Take your CFML Legacy Apps to ModernizationTake your CFML Legacy Apps to Modernization
Take your CFML Legacy Apps to ModernizationOrtus Solutions, Corp
 
Software Engineering Thailand: Programming with Scala
Software Engineering Thailand: Programming with ScalaSoftware Engineering Thailand: Programming with Scala
Software Engineering Thailand: Programming with ScalaBrian Topping
 
Kevin Whinnery: Write Better JavaScript
Kevin Whinnery: Write Better JavaScriptKevin Whinnery: Write Better JavaScript
Kevin Whinnery: Write Better JavaScriptAxway Appcelerator
 
Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slideselliando dias
 
JSR 335 / java 8 - update reference
JSR 335 / java 8 - update referenceJSR 335 / java 8 - update reference
JSR 335 / java 8 - update referencesandeepji_choudhary
 
Scala Days Chicago 2017: Building a Company on Scala
Scala Days Chicago 2017: Building a Company on ScalaScala Days Chicago 2017: Building a Company on Scala
Scala Days Chicago 2017: Building a Company on ScalaNatalie Vegel
 
Robotics, Search and AI with Solr, MyRobotLab, and Deeplearning4j
Robotics, Search and AI with Solr, MyRobotLab, and Deeplearning4jRobotics, Search and AI with Solr, MyRobotLab, and Deeplearning4j
Robotics, Search and AI with Solr, MyRobotLab, and Deeplearning4jKevin Watters
 
The Intersection of Robotics, Search and AI with Solr, MyRobotLab, and Deep L...
The Intersection of Robotics, Search and AI with Solr, MyRobotLab, and Deep L...The Intersection of Robotics, Search and AI with Solr, MyRobotLab, and Deep L...
The Intersection of Robotics, Search and AI with Solr, MyRobotLab, and Deep L...Lucidworks
 
TDD and the Legacy Code Black Hole
TDD and the Legacy Code Black HoleTDD and the Legacy Code Black Hole
TDD and the Legacy Code Black HoleNoam Kfir
 
CSP: Huh? And Components
CSP: Huh? And ComponentsCSP: Huh? And Components
CSP: Huh? And ComponentsDaniel Fagnan
 

Semelhante a Into the Land of lambda, One Programmer's Journey Into Functional Programming (20)

The Ideas of Clojure - Things I learn from Clojure
The Ideas of Clojure - Things I learn from ClojureThe Ideas of Clojure - Things I learn from Clojure
The Ideas of Clojure - Things I learn from Clojure
 
Frontend as a first class citizen
Frontend as a first class citizenFrontend as a first class citizen
Frontend as a first class citizen
 
Generalization in Auto-Testing. How we put what we had into new Technological...
Generalization in Auto-Testing. How we put what we had into new Technological...Generalization in Auto-Testing. How we put what we had into new Technological...
Generalization in Auto-Testing. How we put what we had into new Technological...
 
Clojure in real life 17.10.2014
Clojure in real life 17.10.2014Clojure in real life 17.10.2014
Clojure in real life 17.10.2014
 
Java Closures
Java ClosuresJava Closures
Java Closures
 
The Economies of Scaling Software
The Economies of Scaling SoftwareThe Economies of Scaling Software
The Economies of Scaling Software
 
C# .NET - Um overview da linguagem
C# .NET - Um overview da linguagem C# .NET - Um overview da linguagem
C# .NET - Um overview da linguagem
 
The economies of scaling software - Abdel Remani
The economies of scaling software - Abdel RemaniThe economies of scaling software - Abdel Remani
The economies of scaling software - Abdel Remani
 
Introduction to Clojure
Introduction to ClojureIntroduction to Clojure
Introduction to Clojure
 
Take your CFML Legacy Apps to Modernization
Take your CFML Legacy Apps to ModernizationTake your CFML Legacy Apps to Modernization
Take your CFML Legacy Apps to Modernization
 
Software Engineering Thailand: Programming with Scala
Software Engineering Thailand: Programming with ScalaSoftware Engineering Thailand: Programming with Scala
Software Engineering Thailand: Programming with Scala
 
Kevin Whinnery: Write Better JavaScript
Kevin Whinnery: Write Better JavaScriptKevin Whinnery: Write Better JavaScript
Kevin Whinnery: Write Better JavaScript
 
Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
 
JSR 335 / java 8 - update reference
JSR 335 / java 8 - update referenceJSR 335 / java 8 - update reference
JSR 335 / java 8 - update reference
 
Scala Days Chicago 2017: Building a Company on Scala
Scala Days Chicago 2017: Building a Company on ScalaScala Days Chicago 2017: Building a Company on Scala
Scala Days Chicago 2017: Building a Company on Scala
 
Robotics, Search and AI with Solr, MyRobotLab, and Deeplearning4j
Robotics, Search and AI with Solr, MyRobotLab, and Deeplearning4jRobotics, Search and AI with Solr, MyRobotLab, and Deeplearning4j
Robotics, Search and AI with Solr, MyRobotLab, and Deeplearning4j
 
The Intersection of Robotics, Search and AI with Solr, MyRobotLab, and Deep L...
The Intersection of Robotics, Search and AI with Solr, MyRobotLab, and Deep L...The Intersection of Robotics, Search and AI with Solr, MyRobotLab, and Deep L...
The Intersection of Robotics, Search and AI with Solr, MyRobotLab, and Deep L...
 
TDD and the Legacy Code Black Hole
TDD and the Legacy Code Black HoleTDD and the Legacy Code Black Hole
TDD and the Legacy Code Black Hole
 
Optimera STHLM 2011 - Mikael Berggren, Spotify
Optimera STHLM 2011 - Mikael Berggren, SpotifyOptimera STHLM 2011 - Mikael Berggren, Spotify
Optimera STHLM 2011 - Mikael Berggren, Spotify
 
CSP: Huh? And Components
CSP: Huh? And ComponentsCSP: Huh? And Components
CSP: Huh? And Components
 

Último

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 

Último (20)

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 

Into the Land of lambda, One Programmer's Journey Into Functional Programming

  • 1. Into the Land of Lambda (into functional-programming (one (programmers-journey)))
  • 2. Who am I? Currently, a programmer @livingsocial Previously a software consultant at various Fortune 1000 companies, including banking, pharma, and transportation sectors Lots of work with start-ups since 2005 Speaker at first Rails Conf (‘06), Ruby Conf (‘08) Sarasota resident since ‘96  mike.pence@livingsocial.com @mikepence
  • 3. The context of my experience… Tools I have known and loved (starting out)
  • 4. The context of my experience… Tools I have known and loved (oy! the 90’s!) You had to re-invent yourself every 2 years 
  • 5. The context of my experience… True love since ’05 (well, love/hate with Rails)
  • 6. ~25 years of OOP (for me) How come it isn’t getting any easier?
  • 7. Our relationship with objects It’s complicated • Graphs (trees) of objects maintain internal state at every level in the call stack • Bugs are the product of programmatic logic + the transient state of the world at the time of the error • Example-based unit or integration tests are of limited usefulness (they prove their example case, but nothing more) • No guarantee that calling the same method with the same arguments will return the same result (aka referential transparency) because variables
  • 8. Reasoning about objects Feels Like A Shell Game
  • 9. Attempts to make OOP better Each with their own trade-offs… • Dependency injection / AOP • Following SOLID design principles • Single Responsibility Principle • Liskov Substitution Principle • Etc. • Hexagonal Architecture • Ports and Adapters • Pipes and Filters Still the fundamental problem remains that state is casually managed, if managed at all. Nevermind concurrency!
  • 10. This Talk Gets Its Own Slide “Are we there yet?” http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey The conflation of behavior, state, identity and time is a big source of implicit complexity in current object systems. We should primarily be programming with pure functions and immutable values. - Rich Hickey
  • 11. Is There a Different Way? (Spoiler alert: There is!)
  • 12. Another way Disambiguating identity, value, time and mutation
  • 13. Statefulness, YAGNI Avoid it most of the time. Manage it when you need it. • 99% of the time, you don’t need internal state in functions / methods • As an exercise, try passing in variables and having mutated values returned in <language you use daily> • But Clojure is not about avoiding state, it is about managing it with well-defined semantics • To re-iterate, identity is a sequence of states • America is an identity • The PIC (prez, vice prez) are transient
  • 14. A couple more analogies State is like garbage, or Buddhism (which is not) • Clojure provides "managed time" in much the same way that GC's have come to provide managed memory • * My team at LS offered a lot of this content • They say Buddhists with advanced training don't see a "video" through their eyes, but something like a series of pictures, like a flip book • This "epochal state model" concept is similar, differs in that there are multiple perceivers observing/looking at many flowing identities
  • 16. Some Code Samples Here they are! • http://nakkaya.com/2009/10/04/fractals-in-clojure-buddhabrot-fractal/ • http://wicketconsole.appspot.com/clojureWithTemplates • http://www.slideshare.net/alexmiller/clojure-the-art-of-abstraction-7161663
  • 17. A Whole New World Full of win!
  • 18. Clojure / FP Wins Reliability • Code is “provable” because it lacks transient variables – Tests pass in all required state – Example-based (unit) tests are great • Generative tests are better • Stepping debuggers and similar approaches to diagnosing functions with variables are simply not needed (but are available). • My experience so far has been that a whole class of bugs simply don’t occur
  • 19. Clojure / FP Wins Focus • You focus on a small set of hierarchical data structures and the functions that process them – Visualize any JSON nested structure you have seen • Biggest take-away for me – You simply don’t need all of the ceremony of OOP "It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures." — Alan Perlis
  • 20. Clojure / FP Wins Expressivity and elegance • Your functions and the built-in functions, or library functions, are syntactical peers • So no awkwardly implemented DSL’s • No odd, arbitrary-seeming mix of infix, postfix and dot notation • It is functions, all the way down • So you can freely build your own vocabulary of functions to model your problem domain and solution • Which I am really excited to see in practice • Also, macros!
  • 21. Clojure / FP Wins Access to awesome libraries and community https://github.com/trending?l=clojure&since=weekly
  • 22. Clojure / FP Wins More • Concurrent and performant • On the JVM • With all the goodness that brings • Used by LivingSocial for their massive email processing needs • Plays well with Java • But not just for Java! • CLR version • Enables Unity3D and Unreal Engine programming! • JavaScript version • ClojureScript • A whole awesome thing in its own right • Port of Clojure’s immutable data structure libraries included • Om and React.js, OMG! • You could program for tablets, consoles, phones, etc. • LightTable!
  • 24. Thank you! For Your Participation
  • 25. Questions and Discussion This subheading intentionally left blank