RedDotRubyConf 2014: Magenta is a Lie - and other tales of abstraction

RedDotRubyConf 2014: Magenta is a Lie - and other tales of abstraction

Abstraction is a fundamental approach in programming. It shapes how we solve problems, it is a defining factor in how we view the internals of software and even the world surrounding it and us. The questions of when, how and what to abstract are some of the biggest in computer science and can make the difference between good and bad code. This talk is a fresh take on different facets of abstractions we encounter, build on and have to fight with.

5c2b452f6eea4a6d84c105ebd971d2a4?s=128

Konstantin Haase

June 26, 2014
Tweet

Transcript

  1. Magenta is a Lie and other tales of abstraction

  2. None
  3. None
  4. None
  5. None
  6. None
  7. None
  8. Abstraction

  9. –Zachary Scott “Too much magic… Um, you mean in general?

    It can make make stuff simpler to understand, if that’s your goal. But it’s easy to go too far.”
  10. None
  11. Basis of Science

  12. None
  13. None
  14. None
  15. None
  16. Picking the right abstraction is crucial

  17. In Computer Science, everything is an abstraction

  18. None
  19. With a lot of room for interpretation

  20. This makes it similar to art

  21. None
  22. Abstracting away Semantics

  23. Generic Algorithms

  24. None
  25. None
  26. None
  27. None
  28. Data Abstraction

  29. “Dataless Programming” RM Balzer - 1967

  30. None
  31. None
  32. None
  33. Control Abstraction

  34. Subroutines

  35. “Go To Statement considered harmfull” Edsger Dijkstra, 1968

  36. “Protection in Programming Languages" James H. Morris Jr., 1973

  37. None
  38. You should be able to reason about modules in isolation

  39. “Global Variables Considered Harmful” W.A. Wulf, M. Shaw, 1973

  40. Data Abstraction + Control Abstraction = Object Oriented Programming?

  41. None
  42. #alankayholdingthings

  43. –Alan Kay “OOP to me means only messaging, local retention

    and protection and hiding of state- process, and extreme late-binding of all things.”
  44. None
  45. None
  46. We make the rules

  47. Some rules enable good programs (For some definition of good.)

  48. Single Responsibility Principle

  49. Liskov Substitution Principle

  50. Law of Demeter

  51. None
  52. Don’t abstract too much, too early

  53. None
  54. Is inheritance a good abstraction?

  55. Used for type hierarchy and implementation sharing

  56. None
  57. Strong external abstractions allow weak internal abstractions

  58. Distributed Applications

  59. None
  60. Abstraction as a Security Issue

  61. Almost all attacks rely on switching up or down abstraction

    levels
  62. None
  63. Social Engineering

  64. None
  65. Abstraction

  66. UI as Abstraction

  67. Metaphor

  68. None
  69. Colour

  70. Light

  71. None
  72. None
  73. None
  74. Trichromacy

  75. None
  76. None
  77. None
  78. None
  79. None
  80. None
  81. None
  82. None
  83. None
  84. ?

  85. ?

  86. None
  87. None
  88. Is magenta real?

  89. # FF00FF

  90. None
  91. None
  92. Leaky abstraction?

  93. None
  94. None
  95. Space

  96. None
  97. None
  98. None
  99. None
  100. Tetrachromacy

  101. None
  102. 2-3% of all women? 50% of all women?

  103. Gene on X chromosome OPN1MW and OPN1MW2

  104. Women could have up to six colour cones

  105. Mostly dysfunctional

  106. At least two confirmed cases

  107. Seeing millions of more colours

  108. None
  109. None
  110. None
  111. None
  112. None
  113. None
  114. Why dysfunctional? (my own unscientific theory)

  115. We don’t see colours with our eyes

  116. We see colours with our brain

  117. Our brain adjusts colours

  118. We don’t see colours we don’t have an abstract concept

    for
  119. None
  120. When we learn to speak, colour perception switches from left

    brain side to right brain side
  121. None
  122. Himba Tribe (Namibia)

  123. None
  124. zuzu: dark shades of blue, red, green and purple !

    vapa: white, some shades of yellow ! buru: some shades of green and blue ! dambu: some shades of green, red and brown
  125. None
  126. None
  127. None
  128. Abstraction happens in our minds

  129. All abstraction

  130. OOP happens in our mind, not our computer

  131. UI happens in our mind, not our computer

  132. None
  133. None
  134. “Anything that is in the world when you’re born is

    normal and ordinary and is just a natural part of the way the world works. ! Anything that's invented between when you’re fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. ! Anything invented after you're thirty-five is against the natural order of things” –Douglas Adams
  135. None
  136. Countries exist in our mind

  137. In our collective mind

  138. Changing abstractions is a basic principle of innovation and progress

  139. None
  140. Is magenta a colour?

  141. None
  142. Yes

  143. None
  144. Thanks! @konstantinhaase me@rkh.im