SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances

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
 

Tendances (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
 

En vedette

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
 

En vedette (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?
 

Similaire à 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
 

Similaire à 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
 

Dernier

Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...Akihiro Suda
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfYashikaSharma391629
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 

Dernier (20)

Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 

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