SlideShare a Scribd company logo
Globalcode	–	Open4education
Impactos no design utilizando
programação funcional
Luiz Costa
gutomcosta@gmail.com / @gutomcosta
twitter.com/gutomcosta
github.com/gutomcosta
www.sagadoprogamador.com.br
medium.com/saga-do-programador
orientação a objetos
conjunto de ideias
encapsulamento polimorfismo
objetos herança
estado ...
programação funcional
conjunto de ideias
funções higher-order functions
imutabilidade lazy evaluation
recursão ...
Dois estilos de escrita
código imperativo
Foco no “como fazer”
código declarativo
Foco no “o que fazer”
código declarativo
Foco no “o que fazer”
“When writing a modular program to solve a problem,
one first divides the problem into subproblems, then
solves the subproblems, and finally combines the
solutions. The ways in which one can divide up the
original problem depend directly on the ways in which
one can glue solutions together.”
“Why functional programming matters”
-John Hughes in Research topics in functional programming, 1990
“When writing a modular program to solve a problem,
one first divides the problem into subproblems, then
solves the subproblems, and finally combines the
solutions. The ways in which one can divide up the
original problem depend directly on the ways in which
one can glue solutions together.”
“Why functional programming matters”
-John Hughes in Research topics in functional programming, 1990
“When writing a modular program to solve a problem,
one first divides the problem into subproblems, then
solves the subproblems, and finally combines the
solutions. The ways in which one can divide up the
original problem depend directly on the ways in which
one can glue solutions together.”
“Why functional programming matters”
-John Hughes in Research topics in functional programming, 1990
..argue in the remainder of this paper that functional
languages provide two new, very important kinds of
glue.
“Why functional programming matters”
-John Hughes in Research topics in functional programming, 1990
higher order function lazy evaluation
building blocks
first class functions
uma variável?
invocando uma função
função como parâmetro
invoca a função
mesma função variando comportamento
dados e funções separados
higher order function
uma funcão que recebe outra função como
argumento ou retorna uma função
Como First Class
Functions e Higher
Order Functions podem
impactar nas decisões
de design?
OO foco na estrutura
Como substituir uma implementação em
runtime?
FP foco na transformação
transformação?
listas, map, reduce, filter
map
capitalize capitalize capitalize
Jose Paulo Luiz
jose luizpaulo
TextTextTextText
clojure.string
focus on results, not
steps
“Functional Thinking”
-Neal Ford - IBM Developer Works series
Filter clojure.string
1 2 3 4 5 6 7 8 9
Argentum
Análise de Candlesticks, bolsa de valores
Candlesticks
Argentum
Domain Model
como representar os
conceitos?
Negócio, Candlestick
Impactos no Design utilizando programação funcional Light Talk
define uma abstração
dados e funções separados
decompose an algorithm into functions that are
simple, meaningful and useful.
“Tutorial on Good Lisp Programming Style”
-Peter Norvig in 1992
decompose an algorithm into functions that are
simple, meaningful and useful.
“Tutorial on Good Lisp Programming Style”
-Peter Norvig in 1992
decomposição
invariantes
decomposição
dependência de outro
namespace
Argentum
Geração de gráfico com indicadores define uma
abstração
define comportamentos diferentes
como variar o
comportamento?
declara as funções
compondo funções
higher order functions
decomposição de função
calculando a média móvel
com diferentes
building blocks, é
preciso repensar as
decisões de design
OO e FP Juntos?
Functional in the small, OO in the large.
“Tell Above, and Ask Below - Hybridizing OO and Functional design”
-Michael Feathers, blog post
Functional Core, imperative shell.
“Destroy all software - episode 72”
-Gary Bernhardt, destroy on software screen cast series
conclusão
Functional Programming is more
a mindset than a particular set
of tools or languages.
“Functional Thinking”
-Neal Ford - IBM Developer Works series
Obrigado
Referências
SICP - http://mitpress.mit.edu/sicp/full-text/book/book.html
Why functional programming matters - http://www.cs.kent.ac.uk/people/staff/dat/miranda/whyfp90.pdf
Clojure - http://clojure.org/
Functional Thinking - http://www.ibm.com/developerworks/java/library/j-ft1/index.html
Tell Above, and ask Below - http://michaelfeathers.typepad.com/michael_feathers_blog/2012/03/
tell-above-and-ask-below-hybridizing-oo-and-functional-design.html
Functional Core, imperative shell - https://www.destroyallsoftware.com/screencasts/catalog/
functional-core-imperative-shell
Tutorial on good lisp programming style - http://www.cs.umd.edu/~nau/cmsc421/norvig-lisp-
style.pdf
Ad

More Related Content

Similar to Impactos no Design utilizando programação funcional Light Talk (20)

Concepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming LanguagesConcepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming Languages
ppd1961
 
OOP Java
OOP JavaOOP Java
OOP Java
Saif Kassim
 
OSCON 2014: Data Workflows for Machine Learning
OSCON 2014: Data Workflows for Machine LearningOSCON 2014: Data Workflows for Machine Learning
OSCON 2014: Data Workflows for Machine Learning
Paco Nathan
 
Object-Oriented Analysis and Design
Object-Oriented Analysis and DesignObject-Oriented Analysis and Design
Object-Oriented Analysis and Design
RiazAhmad786
 
Design Patterns and Form Processing
Design Patterns and Form ProcessingDesign Patterns and Form Processing
Design Patterns and Form Processing
Jaime Metcher
 
Booting into functional programming
Booting into functional programmingBooting into functional programming
Booting into functional programming
Dhaval Dalal
 
Comparison of OOP with Procedural and Functional Programming
Comparison of OOP with Procedural and Functional ProgrammingComparison of OOP with Procedural and Functional Programming
Comparison of OOP with Procedural and Functional Programming
infoguestbloging
 
Are High Level Programming Languages for Multicore and Safety Critical Conver...
Are High Level Programming Languages for Multicore and Safety Critical Conver...Are High Level Programming Languages for Multicore and Safety Critical Conver...
Are High Level Programming Languages for Multicore and Safety Critical Conver...
InfinIT - Innovationsnetværket for it
 
Modular programming
Modular programmingModular programming
Modular programming
Mohanlal Sukhadia University (MLSU)
 
Final ppt
Final pptFinal ppt
Final ppt
Ankit Gupta
 
5-CEN6016-Chapter1.ppt
5-CEN6016-Chapter1.ppt5-CEN6016-Chapter1.ppt
5-CEN6016-Chapter1.ppt
DrCMeenakshiVISTAS
 
Different paradigms for problem solving.pptx
Different paradigms for problem solving.pptxDifferent paradigms for problem solving.pptx
Different paradigms for problem solving.pptx
iitjeesooraj
 
Software Design
Software DesignSoftware Design
Software Design
Ahmed Misbah
 
Prototyping Workshop - Wireframes, Mockups, Prototypes
Prototyping Workshop - Wireframes, Mockups, PrototypesPrototyping Workshop - Wireframes, Mockups, Prototypes
Prototyping Workshop - Wireframes, Mockups, Prototypes
Marta Soncodi
 
Evolving as a professional software developer
Evolving as a professional software developerEvolving as a professional software developer
Evolving as a professional software developer
Anton Kirillov
 
BSSML16 L10. Summary Day 2 Sessions
BSSML16 L10. Summary Day 2 SessionsBSSML16 L10. Summary Day 2 Sessions
BSSML16 L10. Summary Day 2 Sessions
BigML, Inc
 
Data Workflows for Machine Learning - Seattle DAML
Data Workflows for Machine Learning - Seattle DAMLData Workflows for Machine Learning - Seattle DAML
Data Workflows for Machine Learning - Seattle DAML
Paco Nathan
 
Keynote at-icpc-2020
Keynote at-icpc-2020Keynote at-icpc-2020
Keynote at-icpc-2020
Ralf Laemmel
 
Developer disciplines
Developer disciplinesDeveloper disciplines
Developer disciplines
Chris Howe-Jones
 
Object Oriented Programming Part 2 of Unit 1
Object Oriented Programming Part 2 of Unit 1Object Oriented Programming Part 2 of Unit 1
Object Oriented Programming Part 2 of Unit 1
VigneshkumarPonnusam1
 
Concepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming LanguagesConcepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming Languages
ppd1961
 
OSCON 2014: Data Workflows for Machine Learning
OSCON 2014: Data Workflows for Machine LearningOSCON 2014: Data Workflows for Machine Learning
OSCON 2014: Data Workflows for Machine Learning
Paco Nathan
 
Object-Oriented Analysis and Design
Object-Oriented Analysis and DesignObject-Oriented Analysis and Design
Object-Oriented Analysis and Design
RiazAhmad786
 
Design Patterns and Form Processing
Design Patterns and Form ProcessingDesign Patterns and Form Processing
Design Patterns and Form Processing
Jaime Metcher
 
Booting into functional programming
Booting into functional programmingBooting into functional programming
Booting into functional programming
Dhaval Dalal
 
Comparison of OOP with Procedural and Functional Programming
Comparison of OOP with Procedural and Functional ProgrammingComparison of OOP with Procedural and Functional Programming
Comparison of OOP with Procedural and Functional Programming
infoguestbloging
 
Are High Level Programming Languages for Multicore and Safety Critical Conver...
Are High Level Programming Languages for Multicore and Safety Critical Conver...Are High Level Programming Languages for Multicore and Safety Critical Conver...
Are High Level Programming Languages for Multicore and Safety Critical Conver...
InfinIT - Innovationsnetværket for it
 
Different paradigms for problem solving.pptx
Different paradigms for problem solving.pptxDifferent paradigms for problem solving.pptx
Different paradigms for problem solving.pptx
iitjeesooraj
 
Prototyping Workshop - Wireframes, Mockups, Prototypes
Prototyping Workshop - Wireframes, Mockups, PrototypesPrototyping Workshop - Wireframes, Mockups, Prototypes
Prototyping Workshop - Wireframes, Mockups, Prototypes
Marta Soncodi
 
Evolving as a professional software developer
Evolving as a professional software developerEvolving as a professional software developer
Evolving as a professional software developer
Anton Kirillov
 
BSSML16 L10. Summary Day 2 Sessions
BSSML16 L10. Summary Day 2 SessionsBSSML16 L10. Summary Day 2 Sessions
BSSML16 L10. Summary Day 2 Sessions
BigML, Inc
 
Data Workflows for Machine Learning - Seattle DAML
Data Workflows for Machine Learning - Seattle DAMLData Workflows for Machine Learning - Seattle DAML
Data Workflows for Machine Learning - Seattle DAML
Paco Nathan
 
Keynote at-icpc-2020
Keynote at-icpc-2020Keynote at-icpc-2020
Keynote at-icpc-2020
Ralf Laemmel
 
Object Oriented Programming Part 2 of Unit 1
Object Oriented Programming Part 2 of Unit 1Object Oriented Programming Part 2 of Unit 1
Object Oriented Programming Part 2 of Unit 1
VigneshkumarPonnusam1
 

More from Luiz Costa (7)

Hexagonal Rails
Hexagonal RailsHexagonal Rails
Hexagonal Rails
Luiz Costa
 
Modular Monoliths - Como é possível organizar sua aplicação para habilitar um...
Modular Monoliths - Como é possível organizar sua aplicação para habilitar um...Modular Monoliths - Como é possível organizar sua aplicação para habilitar um...
Modular Monoliths - Como é possível organizar sua aplicação para habilitar um...
Luiz Costa
 
Como DDD e Strategic Design estão nos ajudando a modernizar um Legado
Como DDD e Strategic Design estão nos ajudando a modernizar um LegadoComo DDD e Strategic Design estão nos ajudando a modernizar um Legado
Como DDD e Strategic Design estão nos ajudando a modernizar um Legado
Luiz Costa
 
Aplicações Práticas de Machine Learning
Aplicações Práticas de Machine LearningAplicações Práticas de Machine Learning
Aplicações Práticas de Machine Learning
Luiz Costa
 
Impactos no design com programação funcional
Impactos no design com programação funcionalImpactos no design com programação funcional
Impactos no design com programação funcional
Luiz Costa
 
A diferença das linguagens da JVM na prática. Um projeto de bolsa de valores ...
A diferença das linguagens da JVM na prática. Um projeto de bolsa de valores ...A diferença das linguagens da JVM na prática. Um projeto de bolsa de valores ...
A diferença das linguagens da JVM na prática. Um projeto de bolsa de valores ...
Luiz Costa
 
Rest Teoria E Pratica
Rest Teoria E PraticaRest Teoria E Pratica
Rest Teoria E Pratica
Luiz Costa
 
Hexagonal Rails
Hexagonal RailsHexagonal Rails
Hexagonal Rails
Luiz Costa
 
Modular Monoliths - Como é possível organizar sua aplicação para habilitar um...
Modular Monoliths - Como é possível organizar sua aplicação para habilitar um...Modular Monoliths - Como é possível organizar sua aplicação para habilitar um...
Modular Monoliths - Como é possível organizar sua aplicação para habilitar um...
Luiz Costa
 
Como DDD e Strategic Design estão nos ajudando a modernizar um Legado
Como DDD e Strategic Design estão nos ajudando a modernizar um LegadoComo DDD e Strategic Design estão nos ajudando a modernizar um Legado
Como DDD e Strategic Design estão nos ajudando a modernizar um Legado
Luiz Costa
 
Aplicações Práticas de Machine Learning
Aplicações Práticas de Machine LearningAplicações Práticas de Machine Learning
Aplicações Práticas de Machine Learning
Luiz Costa
 
Impactos no design com programação funcional
Impactos no design com programação funcionalImpactos no design com programação funcional
Impactos no design com programação funcional
Luiz Costa
 
A diferença das linguagens da JVM na prática. Um projeto de bolsa de valores ...
A diferença das linguagens da JVM na prática. Um projeto de bolsa de valores ...A diferença das linguagens da JVM na prática. Um projeto de bolsa de valores ...
A diferença das linguagens da JVM na prática. Um projeto de bolsa de valores ...
Luiz Costa
 
Rest Teoria E Pratica
Rest Teoria E PraticaRest Teoria E Pratica
Rest Teoria E Pratica
Luiz Costa
 
Ad

Recently uploaded (20)

Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...
Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...
Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...
Journal of Soft Computing in Civil Engineering
 
Reagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptxReagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptx
AlejandroOdio
 
International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)
samueljackson3773
 
Machine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptxMachine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptx
rajeswari89780
 
IntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdfIntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdf
Luiz Carneiro
 
introduction to machine learining for beginers
introduction to machine learining for beginersintroduction to machine learining for beginers
introduction to machine learining for beginers
JoydebSheet
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)
Vəhid Gəruslu
 
15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...
IJCSES Journal
 
ELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdfELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdf
Shiju Jacob
 
Degree_of_Automation.pdf for Instrumentation and industrial specialist
Degree_of_Automation.pdf for  Instrumentation  and industrial specialistDegree_of_Automation.pdf for  Instrumentation  and industrial specialist
Degree_of_Automation.pdf for Instrumentation and industrial specialist
shreyabhosale19
 
Metal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistryMetal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistry
mee23nu
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Journal of Soft Computing in Civil Engineering
 
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdffive-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
AdityaSharma944496
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
Data Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptxData Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptx
RushaliDeshmukh2
 
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdfMAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
ssuser562df4
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.
anuragmk56
 
Reagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptxReagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptx
AlejandroOdio
 
International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)
samueljackson3773
 
Machine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptxMachine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptx
rajeswari89780
 
IntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdfIntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdf
Luiz Carneiro
 
introduction to machine learining for beginers
introduction to machine learining for beginersintroduction to machine learining for beginers
introduction to machine learining for beginers
JoydebSheet
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)
Vəhid Gəruslu
 
15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...
IJCSES Journal
 
ELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdfELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdf
Shiju Jacob
 
Degree_of_Automation.pdf for Instrumentation and industrial specialist
Degree_of_Automation.pdf for  Instrumentation  and industrial specialistDegree_of_Automation.pdf for  Instrumentation  and industrial specialist
Degree_of_Automation.pdf for Instrumentation and industrial specialist
shreyabhosale19
 
Metal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistryMetal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistry
mee23nu
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdffive-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
AdityaSharma944496
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
Data Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptxData Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptx
RushaliDeshmukh2
 
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdfMAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
ssuser562df4
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.
anuragmk56
 
Ad

Impactos no Design utilizando programação funcional Light Talk