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

FP vs. OOP: Beyond the Bikeshed

FP vs. OOP: Beyond the Bikeshed

In object-oriented languages like Ruby, people often say that “everything is an object”—but first-class functions have become standard for object-oriented languages too. C# has had them and other related features for years, and even Java is in the game these days! Some“functional” languages seem to have some very object-oriented-looking features, too. If that sounds wrong to you, let's talk about polymorphism and more in languages like Clojure, Elixir, and even Haskell! So where does object-oriented programming (OOP) end and functional programming (FP) begin?

In this session, we'll look at these programming paradigms with a more critical eye, focusing on where FP and OOP folks fundamentally disagree, where these paradigms have more in common than the industry's rhetoric suggests, and how we can use those insights to make better decisions about the software we build.

Colin Jones

March 22, 2018
Tweet

More Decks by Colin Jones

Other Decks in Technology

Transcript

  1. 8th Light, Inc. FP vs. OOP: Beyond the Bikeshed Colin

    Jones @trptcolin https://8thlight.com
  2. OOP

  3. "OOP to me means only messaging, local retention and protection

    and
 hiding of state-process, and extreme late-binding of all things.” - Alan Kay OOP
  4. "OOP to me means only messaging, local retention and protection

    and
 hiding of state-process, and extreme late-binding of all things.” - Alan Kay OOP
  5. "OOP to me means only messaging, local retention and protection

    and
 hiding of state-process, and extreme late-binding of all things.” - Alan Kay OOP
  6. "OOP to me means only messaging, local retention and protection

    and
 hiding of state-process, and extreme late-binding of all things.” - Alan Kay OOP
  7. FP

  8. more • Parkinson’s Law of Triviality: https://www.farnamstreetblog.com/2013/12/ parkinsons-law/ • How

    the term “bikeshed" got into software: http://bikeshed.com • Alan Kay’s definition of OOP: http://www.purl.org/stefan_ram/pub/ doc_kay_oop_en • Kris Jenkins, “What is Functional Programming”: http://blog.jenkster.com/ 2015/12/what-is-functional-programming.html • Stuart Halloway, “Simplicity Made Easy”: https://youtu.be/cidchWg74Y4 • John Hughes, “Why Functional Programming Matters”: https:// www.cs.kent.ac.uk/people/staff/dat/miranda/whyfp90.pdf
  9. more • Gamma/Helm/Johnson/Vlissides (Gang of Four), Design Patterns: http://a.co/ 6OdEq4h

    • Chris Okasaki, Purely Functional Data Structures: http://a.co/isBRerv • Gary Bernhardt, “Boundaries”: https://www.destroyallsoftware.com/talks/ boundaries • Peter van Roy and Seif Haridi, Concepts, Techniques, and Models of Computer Programming: https://www.info.ucl.ac.be/~pvr/book.html • Gary Bernhardt, “Ideology”: https://www.destroyallsoftware.com/talks/ideology