SlideShare una empresa de Scribd logo
1 de 51
Descargar para leer sin conexión
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
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

Más contenido relacionado

Similar a Impactos no Design utilizando programação funcional Light Talk

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
 

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

OOP Java
OOP JavaOOP Java
OOP Java
 
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
 
Object-Oriented Analysis and Design
Object-Oriented Analysis and DesignObject-Oriented Analysis and Design
Object-Oriented Analysis and Design
 
Design Patterns and Form Processing
Design Patterns and Form ProcessingDesign Patterns and Form Processing
Design Patterns and Form Processing
 
Booting into functional programming
Booting into functional programmingBooting into functional programming
Booting into functional programming
 
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...
 
Modular programming
Modular programmingModular programming
Modular programming
 
Final ppt
Final pptFinal ppt
Final ppt
 
5-CEN6016-Chapter1.ppt
5-CEN6016-Chapter1.ppt5-CEN6016-Chapter1.ppt
5-CEN6016-Chapter1.ppt
 
Software Design
Software DesignSoftware Design
Software Design
 
Prototyping Workshop - Wireframes, Mockups, Prototypes
Prototyping Workshop - Wireframes, Mockups, PrototypesPrototyping Workshop - Wireframes, Mockups, Prototypes
Prototyping Workshop - Wireframes, Mockups, Prototypes
 
Evolving as a professional software developer
Evolving as a professional software developerEvolving as a professional software developer
Evolving as a professional software developer
 
BSSML16 L10. Summary Day 2 Sessions
BSSML16 L10. Summary Day 2 SessionsBSSML16 L10. Summary Day 2 Sessions
BSSML16 L10. Summary Day 2 Sessions
 
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
 
Keynote at-icpc-2020
Keynote at-icpc-2020Keynote at-icpc-2020
Keynote at-icpc-2020
 
Developer disciplines
Developer disciplinesDeveloper disciplines
Developer disciplines
 
Agile Architecture and Modeling - Where are we Today
Agile Architecture and Modeling - Where are we TodayAgile Architecture and Modeling - Where are we Today
Agile Architecture and Modeling - Where are we Today
 
Mastering Python lesson 4_functions_parameters_arguments
Mastering Python lesson 4_functions_parameters_argumentsMastering Python lesson 4_functions_parameters_arguments
Mastering Python lesson 4_functions_parameters_arguments
 
pythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptxpythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptx
 
Python training
Python trainingPython training
Python training
 

Más de Luiz Costa

Más de Luiz Costa (7)

Hexagonal Rails
Hexagonal RailsHexagonal Rails
Hexagonal Rails
 
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...
 
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
 
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
 
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
 
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 ...
 
Rest Teoria E Pratica
Rest Teoria E PraticaRest Teoria E Pratica
Rest Teoria E Pratica
 

Último

Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Dr.Costas Sachpazis
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
rknatarajan
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 

Último (20)

(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 

Impactos no Design utilizando programação funcional Light Talk