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
85
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
46
Spree
pfac
0
110
Workshop Git 2013
pfac
2
120
Other Decks in Programming
See All in Programming
PHPはいつから死んでいるかの調査
chiroruxx
2
410
Ruby Pattern Matching
bkuhlmann
0
930
単体テストを書かない技術 #phpcon_odawara
o0h
PRO
27
8.5k
Ruby GitHub Packages
bkuhlmann
0
630
障害対応を起点としたもっといい開発と運用のサイクル作りのためにできること / Hatena Enginner Seminar #29
polamjag
0
320
Implementing Design Systems in Swift
seyfoyun
0
370
Elm Form Validation
bkuhlmann
0
510
初心者のためのRubyKaigi入門/RubyKaigi Introduction
a_matsuda
8
1.3k
Elm 0.19.0 Changes
bkuhlmann
0
490
StoreKit2によるiOSのアプリ内課金のリニューアル
kangnux
0
120
Code Reviews
bkuhlmann
4
890
Micro Frontends for Java Microservices - Utah JUG 2024
mraible
PRO
1
100
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
51
8.6k
Producing Creativity
orderedlist
PRO
338
39k
Infographics Made Easy
chrislema
238
18k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
358
22k
Designing for humans not robots
tammielis
248
25k
4 Signs Your Business is Dying
shpigford
176
21k
Thoughts on Productivity
jonyablonski
59
3.9k
Music & Morning Musume
bryan
41
5.6k
The Illustrated Children's Guide to Kubernetes
chrisshort
32
46k
The Mythical Team-Month
searls
216
42k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
33
6k
How GitHub Uses GitHub to Build GitHub
holman
468
290k
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?