< Return to Video

Debt Metaphor

  • 0:00 - 0:02
    Metaphor
  • 0:04 - 0:08
    I became interested in the way metaphors
  • 0:08 - 0:10
    influence how we think
  • 0:10 - 0:14
    after reading George Lakoff and Mark Johnson's
  • 0:14 - 0:15
    "Metaphors We Live By".
  • 0:15 - 0:18
    An important idea is that
  • 0:18 - 0:24
    we reason by analogy with the metaphors
  • 0:24 - 0:26
    that have entered our language.
  • 0:26 - 0:28
    Debt
  • 0:30 - 0:34
    I coined the debt metaphor to explain
  • 0:34 - 0:36
    the refactoring that we were doing
  • 0:36 - 0:39
    on the WyCash product.
  • 0:39 - 0:42
    This was an early product
  • 0:42 - 0:45
    done in Digitalk Smalltalk
  • 0:45 - 0:48
    and it was important to me that
  • 0:48 - 0:50
    we accumulate the learnings we did
  • 0:50 - 0:52
    about the application over time
  • 0:52 - 0:57
    by modifying the program to look
  • 0:57 - 1:01
    as if we have known what we were doing
  • 1:01 - 1:04
    all along and to look as if it had been easy
  • 1:04 - 1:07
    to do in Smalltalk.
  • 1:07 - 1:09
    The explanation I gave to my boss,
  • 1:09 - 1:11
    and this was financial software,
  • 1:11 - 1:15
    was a financial analogy I called "the debt metaphor".
  • 1:15 - 1:19
    And that said that if we failed to make our
  • 1:19 - 1:23
    program align to what we then understood
  • 1:23 - 1:26
    to be the proper way to think about our
  • 1:26 - 1:29
    financial objects, then we were going to
  • 1:29 - 1:32
    continually stumble over that disagreement
  • 1:32 - 1:34
    and that would slow us down which was like
  • 1:34 - 1:37
    paying interests on a loan.
  • 1:37 - 1:39
    Speed
  • 1:40 - 1:42
    With borrowed money you can
  • 1:42 - 1:45
    do something sooner than you might otherwise
  • 1:45 - 1:48
    but then until you pay back that money
  • 1:48 - 1:51
    you will be paying interest.
  • 1:52 - 1:56
    I thought borrowing money was a good idea
  • 1:56 - 1:59
    I thought that rushing software out the door
  • 1:59 - 2:02
    to get some experience with it was a good idea
  • 2:02 - 2:07
    but that of course you would eventually go back
  • 2:07 - 2:09
    and as you learned things about that software
  • 2:09 - 2:12
    you would repay that loan
  • 2:12 - 2:16
    by refactoring the program
  • 2:16 - 2:20
    to reflect your experience as you acquired it.
  • 2:20 - 2:22
    Burden
  • 2:23 - 2:25
    I think that there were plenty of cases
  • 2:25 - 2:29
    where people would rush software out the door
  • 2:29 - 2:32
    and learn things but never put that
  • 2:32 - 2:35
    learning back into the program
  • 2:35 - 2:39
    and that by analogy was borrowing money
  • 2:39 - 2:43
    thinking that you never had to pay it back.
  • 2:43 - 2:46
    Of course, if you do that, say with your
  • 2:46 - 2:48
    credit card, eventually all your income
  • 2:48 - 2:50
    goes to interest and your purchasing power
  • 2:50 - 2:53
    goes to zero. By the same token, if you
  • 2:53 - 2:56
    develop a program for a long period of time
  • 2:56 - 2:58
    by only adding features
  • 2:58 - 3:00
    and never reorganizing it to reflect
  • 3:00 - 3:03
    your understanding of those features
  • 3:03 - 3:05
    then eventually that program simply
  • 3:05 - 3:07
    does not contain any understanding
  • 3:07 - 3:09
    and all efforts to work on it
  • 3:09 - 3:11
    take longer and longer.
  • 3:11 - 3:14
    In other words, the interest is total,
  • 3:14 - 3:16
    you make zero progress.
  • 3:16 - 3:18
    Agility
  • 3:19 - 3:23
    A lot of bloggers at least have explained
  • 3:23 - 3:27
    the debt metaphor and confused it, I think,
  • 3:27 - 3:31
    with the idea that you could write code poorly
  • 3:31 - 3:34
    with the intention of doing a good job later
  • 3:34 - 3:35
    and thinking that
  • 3:35 - 3:38
    that was the primary source of debt.
  • 3:38 - 3:42
    I am never in favor of writing code poorly
  • 3:42 - 3:46
    but I am in favor of writing code to reflect
  • 3:46 - 3:48
    your current understanding of a problem
  • 3:48 - 3:50
    even if that understanding is partial.
  • 3:50 - 3:54
    If you want to be able to go into
  • 3:54 - 3:57
    debt that way by developing software
  • 3:57 - 3:59
    that you do not completely understand,
  • 3:59 - 4:03
    you are wise to make that software reflect
  • 4:03 - 4:05
    your understanding as best as you can
  • 4:05 - 4:08
    so that when it does come time to refactor
  • 4:08 - 4:10
    it is clear what you were thinking
  • 4:10 - 4:11
    when you wrote it,
  • 4:11 - 4:14
    making it easier to refactor it
  • 4:14 - 4:16
    into what your current thinking is now.
  • 4:16 - 4:19
    In other words, the whole debt metaphor,
  • 4:19 - 4:21
    let's say, the ability to pay back debt,
  • 4:21 - 4:24
    and make the debt metaphor work for your
  • 4:24 - 4:26
    advantage depends upon your writing
  • 4:26 - 4:29
    code that is clean enough to be able to refactor
  • 4:29 - 4:32
    as you come to understand your problem.
  • 4:32 - 4:34
    I think that is a good methodology.
  • 4:34 - 4:37
    It is at the heart of Extreme Programming.
  • 4:37 - 4:40
    The debt metaphor is an explanation,
  • 4:40 - 4:42
    one of many explanations for why
  • 4:42 - 4:44
    Extreme Programming works.
Title:
Debt Metaphor
Description:

Ward Cunningham reflects on the history, motivation and common misunderstanding of the "debt metaphor" as motivation for refactoring.

more » « less
Video Language:
English
Duration:
04:44
Angela Freitas edited English subtitles for Debt Metaphor
Angela Freitas edited English subtitles for Debt Metaphor
Angela Freitas edited English subtitles for Debt Metaphor
Angela Freitas edited English subtitles for Debt Metaphor
Angela Freitas edited English subtitles for Debt Metaphor
Angela Freitas edited English subtitles for Debt Metaphor
Angela Freitas edited English subtitles for Debt Metaphor

English subtitles

Revisions