Guest User

Untitled

a guest
Jun 1st, 2014
511
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.16 KB | None | 0 0
  1. Exposed Wiring
  2.  
  3. or
  4.  
  5. Millenium Falcon vs. Macintosh in modern code design
  6.  
  7. Programming nowadays has reached the levels of sophistication such
  8. that peoples' expectation is no longer just that a piece of code
  9. works, but that the experience has transcended the functional, into
  10. the aesthetic. People expect the code to look 'beautiful', to go
  11. down easy, to speak in its own perfectly-tailored, English-like
  12. seamless abstraction. Seamless, in fact, in the literal sense.
  13. Literally "magic is happening inside of this thing, which you
  14. should not worry about, but for which we have gone through great pains
  15. to ensure you get the experience we hand to you on a plate, but you
  16. do not get to look inside the box."
  17.  
  18. In the technology world, of course, the modern Macbook stands as the
  19. symbol of this design philosophy. In a field that has taken decades
  20. to try to _start_ to dredge itself out of supposed ugliness and
  21. complexity, the Mac took the symbolic and business leap to cultivate
  22. an aesthetic consumer experience, free of the details of exactly how
  23. the magic box delivers cat pictures through the intertubes. Because,
  24. the truth is, almost nobody, numerically speaking, cares or wants to
  25. deal with how the thing works.
  26.  
  27. But of course, you and I, dear reader, are not most people. We are
  28. the ones who are paid to understand how the sausage gets made, who
  29. must, on a daily basis, tear open the box to try to attempt, on a
  30. deadline, to figure out what the hell is segfaulting our supposedly
  31. wonderfully sophisticated aesthetic experience.
  32.  
  33. More and better words have been spilled on this topic, by authors
  34. whose words ring true across the years:
  35.  
  36. - [The Law of Leaky Abstractions] [spolsky]
  37. - [Shopcraft as Soulcraft] [crawford]
  38. - [Commodity fetishism] [marx]
  39.  
  40. [spolsky]: http://www.joelonsoftware.com/articles/LeakyAbstractions.html
  41. [crawford]: http://www.amazon.com/Shop-Class-Soulcraft-Inquiry-Value/dp/0143117467
  42. [marx]: http://en.wikipedia.org/wiki/Commodity_fetishism
  43.  
  44. The reductionist explanation of these works starts like this: trying
  45. to build a beautiful facade around our constructions hurts us. It
  46. distracts from understanding where our objects came from, and the
  47. brutality that was required to make them (think iPods made by child
  48. laborers in China). It disempowers us, by dissuading us from
  49. understanding how our constructions work, and by in fact making the
  50. operations of our constructions more complicated, because they try to
  51. hide their details behind more layers of details, rather than making a
  52. simple system that was meant to be laid bare. When everything will be
  53. exposed, the only way to simplify things for the human mind is to in
  54. fact have few parts.
  55.  
  56. The opaque layers and complexities of our systems hurt us in many
  57. places. I think perhaps the most problematic complexity right now is
  58. in our politics and economics, where people feel such lack of
  59. understanding and despair in such a complex system, that they feel
  60. like the system is now not understandable, not influencable, and
  61. ultimately has become a static source of injustice, not justice, not
  62. the hacker ethic or the American can-do spirit or even the
  63. Enlightenment dream that freedom and rationality could make the world
  64. a better place. People have given up.
  65.  
  66. But I digress.
  67.  
  68. There is an opposite icon in tech culture to the Macintosh, one that
  69. embodies the DIY hacker spirit rather than the polished aesthetic of
  70. consumption, and that is the Millenium Falcon. The Millenium Falcon
  71. is, most commonly referred to as a piece of junk, and spends many
  72. parts of most of the Star Wars movies being broken. You can see all
  73. of its parts, and many of its parts are frequently hanging out
  74. exposed, on fire, being tinkered with by Han Solo and his heterosexual
  75. life partner, Chewbacca. But the Millenium Falcon is the fastest ship
  76. in the fleet, it runs the most dangerous missions, and no matter how
  77. much it's broken, a ragtag crew of Han or Chewie or R2D2 can get it
  78. working again in the middle of a firefight, because they understand
  79. how it works and they have access to the components and spare parts
  80. that can patch the thing together, even out in the middle of an
  81. asteroid field.
  82.  
  83. This is a significant point.
  84.  
  85. Taste is a significant thing in engineering design. It's taste, by
  86. and large, that is the first line of defense against confusion and
  87. complexity in a design, because a mass of complexity _feels bad_
  88. and evokes _terrible premonitions of dread_ when you can tell that
  89. something is going to be hard to reason about, hard to debug,
  90. hard to unfuck in six months when the original author has left the
  91. company and it's become your job to fix the site outage in the middle
  92. of the night. Many smart people have the intellectual capacity to
  93. figure out a complex design--you wouldn't have gotten anywhere in the
  94. field without that kind of intellectual capacity. But it's only the
  95. people with some kernel of good taste and judgment who tend to reign
  96. in the madness.
  97.  
  98. So having a taste for simplicity is important, extremely important in
  99. trying to hold together our rapidly spiraling out of control world.
  100. But, to try to reunite the circle, I think there's a kind of
  101. fundamental difference between the simplicity that goes into trying to
  102. make the Millenium Falcon a DIY spaceship, versus a frankly pernicious
  103. so-called simplicity that makes a Macintosh a shiny disposable
  104. consumer device.
  105.  
  106. You can see the forces at work in code, in two of the programming
  107. communities that have some of the highest degree of taste: Ruby and
  108. Lisp. Both of these languages and ecosystems have a high degree
  109. of expressive power, ethics of DRYness, metalinguistic mutability,
  110. and aesthetics of 'simplicity.' And it's here where the two
  111. approaches to 'simplicity' have their most violent and nauseating
  112. conflicts occur.
  113.  
  114. [Zen and the Art of Motorcycle Maintenance] [pirsig] has a great
  115. refrain about words, words that can cut like a knife to try to divide
  116. a concept and lay bare the difference between one side of the concept
  117. and the other, to try to draw a distinction between _quality_ and _not
  118. quality_. For Pirsig, in fact, the most important distinction was not
  119. about enumerating what had quality or not quality, but in fact the
  120. distinction between being aware of quality at all and seeking it,
  121. versus the mass of ordinary experience in which people don't even
  122. realize they throw away their lifetimes, spent occupied on things
  123. completely _orthogonal to_, _oblivious of_ whether they are even
  124. engaged in acts of quality or not. But the word, the conceptual
  125. knife, could _reveal_ into clarity the differences in the world and
  126. thus help us to pursue what we could now see.
  127.  
  128. [pirsig]: http://en.wikipedia.org/wiki/Zen_and_the_Art_of_Motorcycle_Maintenance
  129.  
  130. I think it's important to have a conceptual knife to illuminate the
  131. distinction between what's going on here between the Macintosh vs. the
  132. Millenium Falcon in our code, because I assert that it's real, and I
  133. assert that the difference has true effects on our real day-to-day
  134. struggles. Here's how it goes.
  135.  
  136. In any given system, as the level of abstraction and encapsulation
  137. increases, it's natural to want to hide seemingly unnecessary details
  138. of implementation away from the consumer of a product. This of course
  139. comes with the kind of leaky abstraction assumptions listed above; the
  140. assumptions that:
  141.  
  142. - my client is a _consumer_ and not a co-creator, co-understander,
  143. co-repairing of my product. my client is too busy or too dumb
  144. to understand.
  145. - my code is complete and perfect ; it does not need to be opened up,
  146. modified, debugged, or extended. its outer face is the only thing
  147. anyone will ever need to understand or use.
  148. - my conception is obvious and superior; it does not need to be
  149. opened up to be understood, it does not need to be compared to
  150. existing concepts with different names. My names and concepts
  151. stand in their own self-contained glory, not the names and
  152. concepts that lesser systems have used.
  153.  
  154. Have you seen constructions that embody these attitudes? You will
  155. notice them in abudance among the most "sophisticated" purveyors
  156. of Ruby and Lisp, because they are the attitude of the implicit
  157. convention, the framework, and most of all the DSL.
  158.  
  159. Do you see the difference between the way that programming languages
  160. work, and implicity conventions, frameworks and DSLs? Where
  161. programming languages, to the vast extent, give you explicit axioms of
  162. general-purpose, composable constructs, all of these other constructs
  163. give you narrow, opaque monotools. Where programming languages, if
  164. you've had some first year CS education, can be directly translated
  165. into the operating all the way down to the underlying hardware, DSLs
  166. are damn near impossible even to interpret into the next layer down in
  167. the stack.
  168.  
  169. Have you ever tried to read, much less debug, the Rails source?
  170.  
  171. So let's cut deeper. Everyone knows that abstraction is good, that
  172. higher-order thinking only occurs because of abstraction. What then
  173. is the difference between abstraction that cures and abstraction that
  174. kills? The difference, I think, is at the very top-most layer. The
  175. layer where the creator makes his declaration of arrogance, that he
  176. is the smarter better creator than everybody else, that _he_ sees
  177. beyond the veil to the truth of the how the system works, while
  178. everyone sees the facade.
  179.  
  180. You see, even the implementors of conventions, frameworks and DSLs
  181. have to build their systems out of parts. They see pluggable
  182. components and wires and broken hyperdrives made out of ordinary
  183. commodity parts, just the way that everyone else normally sees all of
  184. their own code. The makers of the platforms still have to use
  185. ordinary broken disappointing tools to make their platforms--the only
  186. difference is that at the end of the day, they wrap up their imperfect
  187. product in a thick opaque layer, and declare to everyone else, fuck
  188. you, I'm better than you, you have to speak my language, which will
  189. clearly cover all cases, rather than ordinary components and
  190. constructs of the underlying base language in which the framework is
  191. actually built.
  192.  
  193. The underlying language, in almost all cases, was built to be simple
  194. and general and composable--a Lego set to make the user be able to do
  195. anything. But the framework is meant to make the user do exactly what
  196. the framework creator deemed acceptable. The Framework actively
  197. prevents or simply just breaks when tried to be composed with other
  198. tools--why would evyer want or need other tools when you have The
  199. Framework?
  200.  
  201. This I think is the sickness at the heart of some of our most
  202. promising ecosystems; that peoples' attraction to having their thing
  203. be pervasively The One True Thing actively distracts us from building
  204. simple interoperable building blocks with which we can *work
  205. together*. Instead of giving each other tool sets, we build
  206. widely-isolated fiefdoms and tell each other you're either with us or
  207. them, and you'll never need another kidnapper, you'll learn to love us
  208. and our One True Way instead. This is what's implied by the
  209. private-pervasive-metaphor approach to design rather than the simple
  210. composable part philosophy.
  211.  
  212. It's all both simpler and more complex than it self. Simpler because
  213. half the time the one-true-abstraction is just a wrapper layer around
  214. all the ordinary parts that we could come to learn and understand--you
  215. could take apart all the DSLs and just have systems that dealt in
  216. their underlying operations--which would all just be functions and
  217. data structures, which are simple, publically known,
  218. well-reasonable-about things. But it's the design approach is also
  219. more complex, because psychologically, sociologically,
  220. architecturally, it implies and embodies hubris, arrogance,
  221. privitization and competition within the field, rather than
  222. collaboration and common effort to things that everyone can understand
  223. and improve into the future, rather than reimplementing the same
  224. bullshit in one framework vs. another.
  225.  
  226. So this I think is at the heart of the issue, right up at that
  227. dividing membrane between the ugly guts on the inside and the
  228. beautiful exterior of your aesthetic experience. The ugly guts are
  229. nothing special, we all could have written and understood them,
  230. perhaps even better than you did. But the outside is what makes them
  231. exclusive, mysterious, uniquely yours in that special way--you were
  232. the creator of the language, not Guido or Matz or Rob or Joe or Rich.
  233. Other men have to speak your words, not you theirs.
  234.  
  235. I don't want to deny people their freedoms. If you want to have it
  236. your own way, I don't think Matz or Rich would care (though Guido or
  237. Rob might). But I do think that, objectively speaking, you help other
  238. people get their jobs done easier, and help the state of the field
  239. improve more, when you build interoperable parts based on common
  240. foundations (e.g., libraries) rather than non-interoperable parts
  241. based on privre ate foundations (e.g., DSLs). And those goals, more
  242. productive teams, evolving common tools and platforms, are really
  243. what helps companies succeed privately and the industry succeed
  244. publicly, not the consumer aesthetic optimization of whatever
  245. particular micro-problem you've identified any given all-consuming
  246. paradigm you're trying to impose.
Advertisement
Add Comment
Please, Sign In to add comment