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

Metaphors We Code By (XProLo)

Metaphors We Code By (XProLo)

Thoughts about metaphor, software design, and why XP's System Metaphor concept has not been as widely adopted as the other XP technical practices.

5358df52bd2ef4f57da1b1cc8634cfd9?s=128

Nat Pryce

May 19, 2014
Tweet

Transcript

  1. Metaphors We Code By Nat Pryce nat@natpryce.com @natpryce

  2. “Each XP software project is guided by a single overarching

    metaphor. Sometimes the metaphor is "naive". ... Sometimes the metaphor needs a little explanation. The words used to identify technical entities should be consistently taken from the chosen metaphor. As development proceeds and the metaphor matures, the whole team will find new inspiration from examining the metaphor.” eXtreme Programming Explained, Kent Beck, 1999 The White Book
  3. [System Metaphor is] “What XP uses to unify an architecture

    and provide naming conventions. A simple shared story of how the system works, a metaphor. This story typically involves a handful of classes and patterns that shape the core flow of the system being built.” http://c2.com/cgi/wiki?SystemMetaphor as of 25/04/2014 The C2 Wiki
  4. “System Metaphor is itself a metaphor for a simple design

    with certain qualities. The most important quality is being able to explain the system design to new people without resorting to dumping huge documents on them. A design should have a structure that helps new people begin contributing quickly. The second quality is a design that makes naming classes and methods consistent.” http://www.extremeprogramming.org/rules/metaphor.html as of 25/04/2014 Ron Jeffries’ Current Description of XP
  5. None
  6. None
  7. The Embodied Mind We live ➢ in the physical world

    ➢ in a culture
  8. Example: MORE IS UP From The Guardian website, 15/05/2014: “OVO

    Energy raises prices 3%” “...soaring values have revived idea of selling part of property portfolio...” “...nation's top 10% owning 44% of household wealth...” “Ministry of justice figures show number of convictions fell by only 69...” “Labour's nosedive in the opinion polls…”
  9. Mapping onto Different Target Domains Up Down Good Bad Happy

    Sad Controlling Controlled Pure Corrupt Abstract Concrete People Animals etc.
  10. Types of Conceptual Metaphor One thing for another, physical for

    abstract Up/Down, Near/Far, Facing towards/away Large/Small Inside/Outside, Boundary, Surface Extent, Covering, … Heavy Bright/Dark ... Ontological Orientation Size Containment Surface Weight Light ...
  11. Entailment and Coherence Read: “Following the report, shares in XYZ

    Inc took a nosedive and were in freefall by close of trading.” Think: “I should bail out of my investment in XYZ Inc. before the stock hits rock bottom.”
  12. Another Example: ARGUMENT IS WAR From The Guardian website, 17/05/2014:

    “Sussex police under fire for 'criminalising' fracking protests” “Nigel Farage has attempted to defend his controversial remarks...” “Michael Gove ordered to seal truce as Clegg hits back...”
  13. Example: AN ARGUMENT IS A BUILDING “Alice's argument is supported

    by recent research.” “The foundations of Bob’s argument are rather shaky.” “Carol has put together a convincing case.”
  14. ARGUMENT IS WAR AN ARGUMENT IS A BUILDING “To demolish

    my opponent’s argument I should undermine it by attacking its weak foundations.” Coherence Of Argument Metaphors
  15. Conceptual / Conventional Metaphor Source Domain Target Domain

  16. Figurative / Unconventional Metaphor Conventional Source Domain Target Domain Unconventional

    Source Domain
  17. Figurative / Unconventional Metaphor Metaphors We Live By, Lakoff and

    Johnson, 1980. “...in getting us to try to understand how it could be true, it makes possible a new understanding…”
  18. The Desktop User Interface Metaphor MacOS

  19. Metaphor Stretched Ad Absurdum Microsoft Bob

  20. Figurative Metaphor Has A Sell By Date iOS 6 iOS

    7
  21. Idioms: Metaphors that have Kicked the Bucket Figurative metaphors can

    become common phrases in language When we forget the original meaning of the phrase, it loses its explanatory power. The phrase fossilises as an idiom
  22. Whatever Happened to the System Metaphor?

  23. Metaphors We Code By

  24. Vertical Orientation Hardware Device Drivers Operating System Application Hardware Device

    Drivers Operating System Application Or?
  25. Vertical Orientation ABSTRACT IS UP CONTROL IS UP PEOPLE IS

    UP HARDWARE IS DOWN (STATIC) DEPENDENCIES POINT DOWNWARDS ...
  26. Containment PROGRAMMING LANGUAGES ARE CONTAINERS CONTROL AT THE CENTER VULNERABLE

    IN THE CENTER “The system is in Java” Encapsulation Hexagonal Architecture Privilege ring levels ...
  27. User-facing features Front-end developer Database back-end Externally facing services ...

    Orientation: Facing Towards Something THE SYSTEM FACES THE USER THE SYSTEM FACES OTHER SYSTEMS
  28. Size Big Data Big Iron Software design diagrams could make

    more use of BIG IS IMPORTANT BIG IS IMPORTANT