Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
The Functional Discipline
Search
Pedro Costa
September 22, 2017
Programming
0
110
The Functional Discipline
Slides of my talk at PartialConf 2017
Pedro Costa
September 22, 2017
Tweet
Share
More Decks by Pedro Costa
See All by Pedro Costa
Interruption Engineering - Part I
pfac
0
54
Spree
pfac
0
120
Workshop Git 2013
pfac
2
130
Other Decks in Programming
See All in Programming
メモリ不足との戦い〜大量データを扱うアプリでの実践例〜
kwzr
1
210
半自動E2Eで手っ取り早くリグレッションテストを効率化しよう
beryu
3
510
API Platform 4.2: Redefining API Development
soyuka
0
470
Android StudioのAIコーディングツール、 ぶっちゃけどうなん???
mkeeda
0
130
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
470
AI時代のUIはどこへ行く?
yusukebe
18
9.4k
時間軸から考えるTerraformを使う理由と留意点
fufuhu
16
4.8k
CSS Linter の現在地 2025年のベストプラクティスを探る
ryo_manba
4
560
Reduxモダナイズ 〜コードのモダン化を通して、将来のライブラリ移行に備える〜
pvcresin
1
110
議事録の要点整理を自動化! サーバレス Bot 構築術
penpeen
3
370
さようなら Date。 ようこそTemporal! 3年間先行利用して得られた知見の共有
8beeeaaat
3
1.5k
アセットのコンパイルについて
ojun9
0
130
Featured
See All Featured
Side Projects
sachag
455
43k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
For a Future-Friendly Web
brad_frost
180
9.9k
How to Think Like a Performance Engineer
csswizardry
26
1.9k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Designing for humans not robots
tammielis
253
25k
Making Projects Easy
brettharned
117
6.4k
Balancing Empowerment & Direction
lara
3
630
The Language of Interfaces
destraynor
161
25k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.6k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
jQuery: Nuts, Bolts and Bling
dougneiner
64
7.9k
Transcript
! " The Functional Discipline Pedro Costa @pfac @iampfac
None
Meet John
Meet John
Meet John
Meet John $ 100
None
An over-engineer
€ 1.0 for SOMEONE
New ideas
New ideas
New ideas
New ideas
New ideas
A functional way 1 2
1 class GenerateBillText 2 attr_accessor :currency, :value 3 4 def
initialize(currency:, value:) 5 @currency = currency 6 @value = value 7 end 8 9 def call 10 # ... generate image through ImageMagick ... 11 end 12 13 private 14 15 # ... any auxiliar method .. 16 end 17 18 GenerateBillText.new(currency: :eur, value: 1)
1 class StepChain 2 attr_accessor :klasses 3 4 def initialize(*klasses)
5 @klasses = klasses 6 end 7 8 def call(initial) 9 klasses.reduce(initial) do |current, klass| 10 klass.new(current).call 11 end 12 end 13 end 14 15 StepChain. 16 new(GenerateBillText, ...). 17 call(currency: :eur, value: 1)
1 class BillTextImage 2 attr_reader :path 3 4 def initialize(path:)
5 @path = path 6 end 7 end 8 9 BillTextImage.new(path: "~/tmp/bill_text.png")
None
None
None
None
None
None
None
?
None
None
?
None
None
OMG
None
None
HELP
– Cambridge Dictionary http://dictionary.cambridge.org/dictionary/english/discipline “the ability to control yourself (…),
even in difficult situations.”
– Cambridge Dictionary http://dictionary.cambridge.org/dictionary/english/discipline “the ability to control yourself (…),
even in difficult situations.”
Discipline is hard
Discipline is optional • You can reinvent the wheel, every
time • You can be inconsistent • You can break boundaries • You just should not.
Who’s disciplined?
None
–Daniel Kahneman, “Thinking, Fast and Slow” “System 1 operates automatically
and quickly, with little or no effort and no sense of voluntary control.”
–Daniel Kahneman, “Thinking, Fast and Slow” “System 2 allocates a!ention
to the effortful mental activities that demand it, (…). The operations (…) are often associated with (…) agency, choice and concentration.”
Habits?
None
–Admiral William H. McRaven “University of Texas at Austin 2014
Commencement Address” https://www.youtube.com/watch?v=pxBQLFLei70 “If you can’t do the little things right, you will never do the big things right.”
None
None
None
None
None
None
None
None
Explore
None
But take caution
None
None
Don’t go too far
In the end
All you need is Discipline
Thank you
! " The Functional Discipline Pedro “John” Costa @pfac @iampfac
Questions?