Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Impactos no design com programação funcional

Impactos no design com programação funcional

Orientação a Objetos é sem dúvidas o paradigma de programação mais utilizado, mas ultimamente temos visto um crescimento significativo no uso de linguagens funcionais. O objetivo desta palestra é mostrar uma abordagem de design que mostra problemas comuns que temos em orientação a objetos dentro do mundo funcional. Para isso, vamos utilizar um sistema que simula algumas operações de bolsa de valores para mostrar como as decisões tomadas em design OO podem ser mapeadas no mundo funcional através da linguagem Clojure.

Luiz Costa

October 19, 2013
Tweet

More Decks by Luiz Costa

Other Decks in Programming

Transcript

  1. “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 Sunday, October 20, 13
  2. “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 Sunday, October 20, 13
  3. “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 Sunday, October 20, 13
  4. ..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 Sunday, October 20, 13
  5. higher order function uma funcão que recebe outra função como

    argumento ou retorna uma função Sunday, October 20, 13
  6. map capitalize Jose jose luiz paulo Text Text Text Text

    clojure.string Sunday, October 20, 13
  7. map capitalize capitalize Jose Paulo jose luiz paulo Text Text

    Text Text clojure.string Sunday, October 20, 13
  8. map capitalize capitalize capitalize Jose Paulo Luiz jose luiz paulo

    Text Text Text Text clojure.string Sunday, October 20, 13
  9. focus on results, not steps “Functional Thinking” -Neal Ford -

    IBM Developer Works series Sunday, October 20, 13
  10. Filter clojure.string 1 2 3 4 5 6 7 8

    9 Sunday, October 20, 13
  11. Filter clojure.string 1 2 3 4 5 6 7 8

    9 Sunday, October 20, 13
  12. Filter clojure.string 1 2 3 4 5 6 7 8

    9 Sunday, October 20, 13
  13. Filter clojure.string 1 2 3 4 5 6 7 8

    9 Sunday, October 20, 13
  14. Filter clojure.string 1 2 3 4 5 6 7 8

    9 Sunday, October 20, 13
  15. Filter clojure.string 1 2 3 4 5 6 7 8

    9 Sunday, October 20, 13
  16. Filter clojure.string 1 2 3 4 5 6 7 8

    9 Sunday, October 20, 13
  17. Filter clojure.string 1 2 3 4 5 6 7 8

    9 Sunday, October 20, 13
  18. Filter clojure.string 1 2 3 4 5 6 7 8

    9 Sunday, October 20, 13
  19. Filter clojure.string 1 2 3 4 5 6 7 8

    9 Sunday, October 20, 13
  20. Filter clojure.string 1 2 3 4 5 6 7 8

    9 Sunday, October 20, 13
  21. decompose an algorithm into functions that are simple, meaningful and

    useful. “Tutorial on Good Lisp Programming Style” -Peter Norvig in 1992 Sunday, October 20, 13
  22. decompose an algorithm into functions that are simple, meaningful and

    useful. “Tutorial on Good Lisp Programming Style” -Peter Norvig in 1992 Sunday, October 20, 13
  23. Argentum Geração de gráfico com indicadores define uma abstração define

    comportamentos diferentes Sunday, October 20, 13
  24. Functional in the small, OO in the large. “Tell Above,

    and Ask Below - Hybridizing OO and Functional design” -Michael Feathers, blog post Sunday, October 20, 13
  25. Functional Core, imperative shell. “Destroy all software - episode 72”

    -Gary Bernhardt, destroy on software screen cast series Sunday, October 20, 13
  26. Functional Programming is more a mindset than a particular set

    of tools or languages. “Functional Thinking” -Neal Ford - IBM Developer Works series Sunday, October 20, 13
  27. 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 Sunday, October 20, 13