why isn’t functional programming the norm? · clojure reasonml potential fp killer apps elm-ui...
TRANSCRIPT
![Page 1: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/1.jpg)
Why isn’t Functional Programming the Norm?
@rtfeldman
![Page 2: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/2.jpg)
Why are thingsthe way they are?
![Page 3: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/3.jpg)
It’s complicated!
![Page 4: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/4.jpg)
Part 1: Language
Part 2: Paradigm
Part 3: Style
![Page 5: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/5.jpg)
Part 1: Language
![Page 6: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/6.jpg)
What languagesare the norm today?
![Page 7: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/7.jpg)
Global developer population report 2019
![Page 8: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/8.jpg)
Total functional
programming languages:
0
![Page 9: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/9.jpg)
1. Killer App
2. Platform Exclusivity
3. Quick Upgrade
How did they get popular?
![Page 10: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/10.jpg)
1. Killer App
![Page 11: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/11.jpg)
Software:$100
Hardware:$10000
![Page 12: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/12.jpg)
“VisiCalc is the first program
available on a microcomputer
that has been responsible for
sales of entire systems.”
-BYTE magazine, 1980
![Page 13: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/13.jpg)
the killer app for
![Page 14: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/14.jpg)
![Page 15: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/15.jpg)
the killer app for
making HTML dynamic
![Page 16: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/16.jpg)
![Page 17: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/17.jpg)
the killer app for
systems programming
![Page 18: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/18.jpg)
![Page 19: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/19.jpg)
Elm
Clojure
ReasonML
Potential FP Killer Appselm-ui
Datomic
revery
![Page 20: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/20.jpg)
2. Platform Exclusivity
![Page 21: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/21.jpg)
![Page 22: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/22.jpg)
![Page 23: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/23.jpg)
iPhone Sales
![Page 24: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/24.jpg)
![Page 25: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/25.jpg)
![Page 26: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/26.jpg)
![Page 27: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/27.jpg)
“Write once, run anywhere.”
![Page 28: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/28.jpg)
3. Quick Upgrade
![Page 29: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/29.jpg)
Benefits
Familiarity
Learning Curve
Ecosystem Access
Code Migration Effort
“It’s just JavaScript”Considerations
![Page 30: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/30.jpg)
“It’s just JavaScript”Benefits
Familiarity
Learning Curve
Ecosystem Access
Code Migration Effort
strict superset of JS
Considerations
![Page 31: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/31.jpg)
Benefits
Familiarity
Learning Curve
Ecosystem Access
Code Migration Effort
near-superset of C
Considerations
![Page 32: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/32.jpg)
Benefits
Familiarity
Learning Curve
Ecosystem Access
Code Migration Effort
“Kotlin is 100% interoperable with [Java] and major emphasis has been placed on making sure that your existing codebase can interact properly with Kotlin.”
Considerations
![Page 33: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/33.jpg)
1. Killer App
2. Platform Exclusivity
3. Quick Upgrade
How did they get popular?C, Ruby, PHP
JS, Objective-C, Swift, C#
C++, Kotlin, TypeScript
![Page 34: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/34.jpg)
1. Killer App
2. Platform Exclusivity
3. Quick Upgrade
4. Epic Marketing
How did they get popular?C, Ruby, PHP
JS, Objective-C, Swift, C#
C++, Kotlin, TypeScript
Java
![Page 35: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/35.jpg)
$500M Java marketing campaign in 2003
![Page 36: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/36.jpg)
![Page 37: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/37.jpg)
1. Killer App
2. Platform Exclusivity
3. Quick Upgrade
4. Epic Marketing
5. Slow & Steady
1. Killer App
2. Platform Exclusivity
3. Quick Upgrade
4. Epic Marketing
How did they get popular?C, Ruby, PHP
JS, Objective-C, Swift, C#
C++, Kotlin, TypeScript
Java
Python
![Page 38: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/38.jpg)
![Page 39: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/39.jpg)
Syntax
Job Market
Community
Other Popularity Factors
![Page 40: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/40.jpg)
Why are the most popular languages OO(except C)?
![Page 41: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/41.jpg)
Part 2: Paradigm
![Page 42: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/42.jpg)
Programming paradigms are a way toclassify programming languages based on their features.Languages can be classified into multiple paradigms.
![Page 43: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/43.jpg)
Are OO languages the normbecause of uniquely OO features?
![Page 44: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/44.jpg)
1. Encapsulation?
2. Inheritance?
3. Objects?
4. Methods?
What are uniquely OO features?
![Page 45: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/45.jpg)
Inheritance
Interface Inheritance (aka subtyping)
Implementation Inheritance (aka inheritance)
![Page 46: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/46.jpg)
“Composition over inheritance”
![Page 47: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/47.jpg)
“Supports an object-oriented style”
No inheritance
“Objects and methods” are
syntax sugar for structs and procedures
encapsulation?
circle.grow(3)
grow(circle, 3)
![Page 48: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/48.jpg)
Modular Programming
Modularity lets you define a public interfaceto hide private implementation details
![Page 49: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/49.jpg)
Languages with modules
*coming in C++20
![Page 50: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/50.jpg)
Modular Programming
Modularity lets you define a public interfaceto hide private implementation details
![Page 51: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/51.jpg)
Encapsulation
Encapsulation lets you define a public interfaceto hide private implementation detailsabout an object’s state
![Page 52: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/52.jpg)
ObjectsClasses
InheritanceGarbage Collection
John McCarthy,Creator of Lisp
![Page 53: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/53.jpg)
ObjectsClasses
InheritanceGarbage Collection
“Object-Oriented” -Alan Kayeverything is an object
OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. It can be done in Smalltalk and in LISP. There are possibly other systems in which this is possible, but I’m not aware of them.
bit.ly/2kqxVWO
![Page 54: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/54.jpg)
“I wasn't happy with C as a productivity foundation, and I was lobbying around for anything that could help. That was about the time the Byte Magazine issue came out.”
ObjectsClasses
InheritanceGarbage CollectionBrad Cox
“I wasn't happy with C as a productivity foundation, and I was lobbying around for anything that could help. That was about the time the Byte Magazine issue came out.” “There were a whole bunch of things I thought vaguely might help. Encapsulation for sure...C is so bad at it. Everything is public; it just turns into soup.The pain of that is what I was trying to escape.”
youtu.be/1xrL2d5omuA
“I wasn't happy with C as a productivity foundation, and I was lobbying around for anything that could help. That was about the time the Byte Magazine issue came out.” “There were a whole bunch of things I thought vaguely might help. Encapsulation for sure...C is so bad at it.
“I wasn't happy with C as a productivity foundation, and I was lobbying around for anything that could help. That was about the time the Byte Magazine issue came out.” “There were a whole bunch of things I thought vaguely might help. Encapsulation for sure...C is so bad at it. Everything is public; it just turns into soup.
![Page 55: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/55.jpg)
![Page 56: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/56.jpg)
ObjectsClasses
InheritanceGarbage Collection
WithClasses
Bjarne Stroustrup
![Page 57: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/57.jpg)
WithClasses
Bjarne Stroustrup
youtu.be/69edOm889V4
Drop-in C Replacement (!)
![Page 58: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/58.jpg)
C with OOP (“C with Classes”) wasn’t sufficient for popularity
Sun wanted familiarity for C++ programmers
Microsoft wanted a proprietary Java alternative
Brad Cox wanted modularity
Apple wanted to improve on ObjC
![Page 59: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/59.jpg)
![Page 60: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/60.jpg)
“I wanted a scripting language that
was more powerful than Perl, and
more object-oriented than Python.”
—Yukihiro “Matz” Matsumoto,
creator of Ruby
![Page 61: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/61.jpg)
![Page 62: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/62.jpg)
Are OO languages the normbecause of uniquely OO features?
They’re OO because modularity is a good idea,and they originally got it from OO by chance.
No.
![Page 63: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/63.jpg)
Part 3: Style
![Page 64: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/64.jpg)
Functional Programming Style
“Avoid mutation and side effects.”
No language features required
Languages differ in their support for this style
![Page 65: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/65.jpg)
Why isn’t FP style the norm?
![Page 66: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/66.jpg)
Kotlin has both object-oriented and functional constructs.
You can use it in both OO and FP styles, or mix elements of the two.
FAQIs Kotlin an object-oriented language or a functional one?
![Page 67: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/67.jpg)
Functional programming patterns, e.g., map and filter
Some additional features of Swift include:
swift.org
![Page 68: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/68.jpg)
![Page 69: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/69.jpg)
![Page 70: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/70.jpg)
![Page 71: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/71.jpg)
![Page 72: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/72.jpg)
OO style FP stylehybrid
![Page 73: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/73.jpg)
“Wouldn’t it be nice if my language had strong support for the style that’s become the norm?”
??????????
![Page 74: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/74.jpg)
Why isn’t Functional Programming the Norm?
@rtfeldman
![Page 75: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/75.jpg)
Part 1: Language
Part 2: Paradigm
Part 3: Style
![Page 76: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/76.jpg)
1. No sufficiently large “killer apps”
2. No exclusivity on large platforms
3. Can’t be a quick upgrade if substantially different
4. No epic marketing budgets
5. Slow & steady growth takes decades
Why aren’t FP languages the norm?
![Page 77: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/77.jpg)
1. Information hiding (encapsulation) is nota uniquely OO feature. Modules can do it too.
2. Inheritance is uniquely OO, but OO best practice encourages using composition instead.
3. Without inheritance, objects and methods are notsignificantly different from structs and procedures.
Are OO languages the normbecause of uniquely OO features?
![Page 78: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/78.jpg)
Why isn’t FP style the norm?
![Page 79: Why isn’t Functional Programming the Norm? · Clojure ReasonML Potential FP Killer Apps elm-ui Datomic revery. 2. Platform Exclusivity. iPhone Sales “Write once, ... Functional](https://reader034.vdocuments.us/reader034/viewer/2022050715/5f20e53295f3ef34c679c7b2/html5/thumbnails/79.jpg)
@rtfeldman