Overview
In 2010, Clojure creator Rich Hickey gave a talk called Hammock Driven Development about how to think before writing code, framed as an experience report rather than a methodology. The video starts from its opening questions: when did you last think about one thing for an hour, a day or a month, and when did you last tackle something new with confidence?
Hickey argues that the cheapest bug is the one never created at design time, and that most big software problems come from misunderstanding what you are building.
Key Points
- Build solutions, not features. State the problem out loud or on paper, then write down what you know, what you don’t know, and how others have solved similar problems.
- Don’t take things at face value. Look for the bad parts of your own and others’ solutions, and only call something a trade-off when you have compared at least two options.
- The waking mind handles analysis and tactics but gets stuck on local peaks. The background mind makes connections and handles strategy such as abstraction, and sleep helps it sort information and find hidden links.
- Since working memory holds only about 7±2 items, load the problem by reviewing your notes repeatedly, then step away from the computer, close your eyes and recall it. Wait at least a night, and switch projects when stuck.
- Then try the idea, typing as little code as possible, and don’t be afraid of being wrong. When the facts change, change your mind.
Chapters
- 0:00 Introduction
- 1:39 Chapter 1: Where is it cheapest to fix a bug?
- 2:32 Chapter 2: Solve the problem
- 3:56 Chapter 3: Problem solving is a skill
- 4:36 Chapter 4: State the problem
- 6:32 Chapter 5: Don’t take things at face value
- 7:17 Chapter 6: Take in input
- 8:28 Chapter 7: Focus
- 9:23 Chapter 8: The waking mind and the background mind
- 11:16 Chapter 9: While you sleep
- 12:34 Chapter 10: Loading the problem
- 13:56 Chapter 11: Waiting
- 15:07 Chapter 12: When you wake up
- 15:26 Chapter 13: Trying it out
- 16:23 Chapter 14: Being wrong
- 17:13 Summary
概要
2010年、Clojureの作者Rich Hickeyは「Hammock Driven Development(ハンモック駆動開発)」という講演を行いました。コードを書く前にどう考えるかについての話で、方法論ではなく体験の報告として語られています。この動画では、「最後に1つのことを1時間、1日、1か月考え続けたのはいつか」「初めてのことに自信を持って取りかかれたのはいつか」という冒頭の問いかけから、講演の内容を順に紹介します。
Rich Hickeyは、修正コストが一番安いのは設計の段階でバグを作らないことであり、ソフトウェアの大きな問題のほとんどは、自分が何を作ろうとしているのかを取り違えたことから生まれると主張します。
ポイント
- 作るべきなのは機能ではなく解決です。問題を声に出すか紙に書き、分かっていること、分かっていないこと、似た問題を先人がどう解いたかを書き出します。
- うのみにしないこと。自分の解決策にも他人の解決策にも悪いところを探しに行き、少なくとも2つの案を比べて初めてトレードオフと呼べます。
- 起きている頭は分析と戦術が得意ですが、近くの頂上で止まりがちです。バックグラウンドの頭は物事を結びつけ、抽象化のような戦略を担い、睡眠は情報を整理して隠れたつながりを見つける助けになります。
- 作業記憶は7±2個ほどしか持てないため、書き出したメモを何度も眺めて問題を頭に積み込み、コンピューターから離れて目を閉じ、思い出します。少なくとも一晩は待ち、行き詰まったら別のプロジェクトに切り替えます。
- そのうえで案を試し、コードはなるべく少なく書き、間違えることを怖がらないこと。事実が変われば考えを変えればよいのです。