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

Abstractions: A Tale of Keys and Values

2274a7476f6d2ac7aedcdec0651d0542?s=47 Ernie Miller
September 01, 2016

Abstractions: A Tale of Keys and Values

As programmers, we know that the right abstraction unlocks new ways of thinking about the problems we solve. But can they do more? Can an abstraction exemplify our values? What might that look like? How would it feel to use? Do these words I'm typing right now even make any sense?

I'd like to share a recent experience with Elixir and Phoenix that convinced me, more than ever, of the power a well-chosen abstraction can have to create a truly joyful development experience.

2274a7476f6d2ac7aedcdec0651d0542?s=128

Ernie Miller

September 01, 2016
Tweet

Transcript

  1. ABSTRACTIONS A TALE OF KEYS AND VALUES ERNIE MILLER erniemiller

    https://ernie.io
  2. None
  3. None
  4. None
  5. None
  6. #!/usr/bin/perl # Print the text of "99 Bottles of Beer"

    ''=~( '(?{' .('`' |'%') .('[' ^'-') .('`' |'!') .('`' |',') .'"'. '\\$' .'==' .('[' ^'+') .('`' |'/') .('[' ^'+') .'||' .(';' &'=') .(';' &'=') .';-' .'-'. '\\$' .'=;' .('[' ^'(') .('[' ^'.') .('`' |'"') .('!' ^'+') .'_\\{' .'(\\$' .';=('. '\\$=|' ."\|".( '`'^'.' ).(('`')| '/').').' .'\\"'.+( '{'^'['). ('`'|'"') .('`'|'/' ).('['^'/') .('['^'/'). ('`'|',').( '`'|('%')). '\\".\\"'.( '['^('(')). '\\"'.('['^ '#').'!!--' .'\\$=.\\"' .('{'^'['). ('`'|'/').( '`'|"\&").( '{'^"\[").( '`'|"\"").( '`'|"\%").( '`'|"\%").( '['^(')')). '\\").\\"'. ('{'^'[').( '`'|"\/").( '`'|"\.").( '{'^"\[").( '['^"\/").( '`'|"\(").( '`'|"\%").( '{'^"\[").( '['^"\,").( '`'|"\!").( '`'|"\,").( '`'|(',')). '\\"\\}'.+( '['^"\+").( '['^"\)").( '`'|"\)").( '`'|"\.").( '['^('/')). '+_,\\",'.( '{'^('[')). ('\\$;!').( '!'^"\+").( '{'^"\/").( '`'|"\!").( '`'|"\+").( '`'|"\%").( '{'^"\[").( '`'|"\/").( '`'|"\.").( '`'|"\%").( '{'^"\[").( '`'|"\$").( '`'|"\/").( '['^"\,").( '`'|('.')). ','.(('{')^ '[').("\["^ '+').("\`"| '!').("\["^ '(').("\["^ '(').("\{"^ '[').("\`"| ')').("\["^ '/').("\{"^ '[').("\`"| '!').("\["^ ')').("\`"| '/').("\["^ '.').("\`"| '.').("\`"| '$')."\,".( '!'^('+')). '\\",_,\\"' .'!'.("\!"^ '+').("\!"^ '+').'\\"'. ('['^',').( '`'|"\(").( '`'|"\)").( '`'|"\,").( '`'|('%')). '++\\$="})' );$:=('.')^ '~';$~='@'| '(';$^=')'^ '[';$/='`';
  7. None
  8. None
  9. None
  10. None
  11. None
  12. None
  13. LOOK, THIS COULD ALL GO HORRIBLY WRONG. Me, in the

    proposal for “Choices” HOW (NOT) TO WEASEL YOUR WAY OUT OF A CONFERENCE SLOT
  14. None
  15. None
  16. THE RIGHT TECH FEELS LIKE A CHEAT CODE.

  17. NBD.

  18. VBD!

  19. ESTIMATES

  20. a false statement made with deliberate intent to deceive; an

    intentional untruth, a falsehood. LIE noun
  21. ⛏➡➡❓

  22. ❓➡⛏➡

  23. * ❗

  24. * ❗ ❗ ❗

  25. None
  26. None
  27. None
  28. None
  29. None
  30. None
  31. None
  32. None
  33. Hash trees can be used to verify any kind of

    data stored, handled and transferred in and between computers. “ — Wikipedia, "Merkle Tree"
  34. […] make sure that data blocks received from other peers

    in a peer-to-peer network are received undamaged and unaltered, and even to check that the other peers do not lie and send fake blocks. “ — Wikipedia, "Merkle Tree"
  35. git rebase

  36. git commit --fixup git rebase --interactive git rebase --autosquash git

    commit --amend git add --interactive
  37. None
  38. None
  39. git push --force

  40. ABSTRACTION

  41. None
  42. you are here.

  43. OPINIONS

  44. OPINIONS

  45. FEELINGS♥

  46. FEELINGS♥ ARE HARD

  47. FEELINGS ARE HARD

  48. SCIENCE

  49. QUANTUM MECHANICS

  50. None
  51. None
  52. None
  53. None
  54. CHRISTIAAN HUYGENS 1629 - 1695

  55. 1643 - 1727 ISAAC NEWTON

  56. 1773 - 1829 THOMAS YOUNG

  57. None
  58. None
  59. The experiments I am about to relate […] may be

    repeated with great ease, whenever the sun shines, and without any other apparatus than is at hand to every one. “ — Thomas Young, November 1803
  60. None
  61. circa 460 BC - 370 BC DEMOCRITUS

  62. None
  63. None
  64. 1856 - 1940 J. J. THOMPSON

  65. 1856 - 1940 J. J. THOMPSON

  66. None
  67. None
  68. 1879 - 1955 ALBERT EINSTEIN

  69. Told you so.

  70. None
  71. None
  72. None
  73. None
  74. None
  75. None
  76. 1901 - 1976 WERNER HEISENBERG 1885 - 1962 NIELS BOHR

  77. None
  78. None
  79. None
  80. None
  81. 1887 - 1961 ERWIN SCHRÖDINGER

  82. 1887 - 1961 ERWIN SCHRÖDINGER

  83. Left to right: Albert Einstein, Boris Podolsky, and Nathan Rosen.

  84. CORRECT, BUT NOT COMPLETE.

  85. Flickr: Apionid
 CC BY-NC-ND 2.0

  86. None
  87. None
  88. 1930 - 1982 HUGH EVERETT III

  89. None
  90. Dear Schrödinger: You are the only contemporary physicist, besides Laue,

    who sees that one cannot get around the assumption of reality, if only one is honest. “ — Einstein, December 22nd, 1950
  91. None
  92. ESTIMATES

  93. None
  94. None
  95. None
  96. None
  97. http://simulation-argument.com/simulation.pdf

  98. None
  99. None
  100. None
  101. None
  102. None
  103. None
  104. None
  105. None
  106. IGNORANCE IS BLISS.

  107. ABSTRACTION

  108. FEELINGS WARNING! AHEAD ⚠

  109. SCIENCE

  110. ENGINEERING

  111. ART

  112. SUSPENSION
 OF DISBELIEF

  113. SUSPENSION
 OF DISBELIEF

  114. CONTEXT

  115. defmodule Person do defstruct name: "" end

  116. None
  117. None
  118. This is me.

  119. None
  120. ELEMENTAL

  121. ELEMENTAL

  122. CSS HTML JS State

  123. ❓ ☔

  124. ‼ ☔

  125. None
  126. ⚠ %section.container %h1= post.title %h2= post.subtitle .content = post.content

  127. ⚠ $font-stack: Helvetica, sans-serif $primary-color: #333 body font: 100% $font-stack

    color: $primary-color
  128. ⚠ number = 42 opposite = true number = -42

    if opposite square = (x) -> x * x list = [1, 2, 3, 4, 5] math = root: Math.sqrt square: square cube: (x) -> x * square x
  129. State

  130. EEx State

  131. EEx c State

  132. EEx c State

  133. EEx c State

  134. None
  135. None
  136. None
  137. Chrome iOS

  138. None
  139. None
  140. None
  141. None
  142. None
  143. None
  144. BUILDING A STATEFUL APPLICATION ON THE BACK OF A STATELESS

    PROTOCOL IS A TOTALLY REASONABLE PLAN. Many, many liars. Including me. NOPE.
  145. None
  146. EEx c Processes

  147. PROCESSES

  148. PROCESSES Wikimedia: Jdcollins13 - CC-BY-SA 3.0

  149. PROCESSES MESSAGES &

  150. HONESTY KEY VALUE:

  151. None
  152. None
  153. None
  154. None
  155. KINDNESS KEY VALUE:

  156. JIKASWAK JOSÉ IS KIND AND SO WE ARE KIND

  157. COME FOR THE TECH. STAY FOR THE
 PEOPLE. ERNIE MILLER

    erniemiller https://ernie.io
  158. COME FOR THE TECH. STAY FOR THE
 PEOPLE. ERNIE MILLER

    erniemiller https://ernie.io ❤