目次
6
1. Introduction
2. The Nature of Complexity
3. Working Code isn’t Enough
4. Modules Should Be Deep
5. Information Hiding (and Leakage)
6. General-Purpose Modules are Deeper
7. Different Layer, Different Abstraction
8. Pull Complexity Downwards
9. Better Together Or Better Apart?
10. Define Errors Out Of Existence
11. Design it Twice
12. Why Write Comments? The Four Excuses
13. Comments Should Describe Things
That Aren’t Obvious From The Code
14. Choosing Names
15. Write The Comments First
16. Modifying Existing Code
17. Consistency
18. Code Should Be Obvious
19. Software Trends
20. Designing for Performance
21. Decide What Matters (省略)
22. Conclusion (省略)
Slide 7
Slide 7 text
目次
7
1. Introduction
2. The Nature of Complexity
3. Working Code isn’t Enough
4. Modules Should Be Deep
5. Information Hiding (and Leakage)
6. General-Purpose Modules are Deeper
7. Different Layer, Different Abstraction
8. Pull Complexity Downwards
9. Better Together Or Better Apart?
10. Define Errors Out Of Existence
11. Design it Twice
12. Why Write Comments? The Four Excuses
13. Comments Should Describe Things
That Aren’t Obvious From The Code
14. Choosing Names
15. Write The Comments First
16. Modifying Existing Code
17. Consistency
18. Code Should Be Obvious
19. Software Trends
20. Designing for Performance
21. Decide What Matters
22. Conclusion
目次
9
1. Introduction
2. The Nature of Complexity
3. Working Code isn’t Enough
4. Modules Should Be Deep
5. Information Hiding (and Leakage)
6. General-Purpose Modules are Deeper
7. Different Layer, Different Abstraction
8. Pull Complexity Downwards
9. Better Together Or Better Apart?
10. Define Errors Out Of Existence
11. Design it Twice
12. Why Write Comments? The Four Excuses
13. Comments Should Describe Things
That Aren’t Obvious From The Code
14. Choosing Names
15. Write The Comments First
16. Modifying Existing Code
17. Consistency
18. Code Should Be Obvious
19. Software Trends
20. Designing for Performance
21. Decide What Matters
22. Conclusion
Chap 2
“One of the most important goals of good design is
for a system to be obvious.”
優れた設計の最も重要な目標の1つは
システムが明白であることだ
Ousterhout, John K. . A Philosophy of Software Design, 2nd Edition (p. 9).
Yaknyam Press. Kindle Edition.
12
複雑性はちりつも (incremental)
● 1つの致命的なミスが生み出すわけではなく
小さな塊が積み重なって起きる
Chap 2
15
Slide 16
Slide 16 text
目次
16
1. Introduction
2. The Nature of Complexity
3. Working Code isn’t Enough
4. Modules Should Be Deep
5. Information Hiding (and Leakage)
6. General-Purpose Modules are Deeper
7. Different Layer, Different Abstraction
8. Pull Complexity Downwards
9. Better Together Or Better Apart?
10. Define Errors Out Of Existence
11. Design it Twice
12. Why Write Comments? The Four Excuses
13. Comments Should Describe Things
That Aren’t Obvious From The Code
14. Choosing Names
15. Write The Comments First
16. Modifying Existing Code
17. Consistency
18. Code Should Be Obvious
19. Software Trends
20. Designing for Performance
21. Decide What Matters
22. Conclusion
戦略(Strategic) vs 戦術(Tactical)
● 戦略(strategic)
○ 重要なのは長期目線でのスピードアップ
● 10-20%の開発時間を投資すべき; 数ヶ月で回収できるだろう
Chap 3
18
Slide 19
Slide 19 text
目次
19
1. Introduction
2. The Nature of Complexity
3. Working Code isn’t Enough
4. Modules Should Be Deep
5. Information Hiding (and Leakage)
6. General-Purpose Modules are Deeper
7. Different Layer, Different Abstraction
8. Pull Complexity Downwards
9. Better Together Or Better Apart?
10. Define Errors Out Of Existence
11. Design it Twice
12. Why Write Comments? The Four Excuses
13. Comments Should Describe Things
That Aren’t Obvious From The Code
14. Choosing Names
15. Write The Comments First
16. Modifying Existing Code
17. Consistency
18. Code Should Be Obvious
19. Software Trends
20. Designing for Performance
21. Decide What Matters
22. Conclusion
目次
25
1. Introduction
2. The Nature of Complexity
3. Working Code isn’t Enough
4. Modules Should Be Deep
5. Information Hiding (and Leakage)
6. General-Purpose Modules are Deeper
7. Different Layer, Different Abstraction
8. Pull Complexity Downwards
9. Better Together Or Better Apart?
10. Define Errors Out Of Existence
11. Design it Twice
12. Why Write Comments? The Four Excuses
13. Comments Should Describe Things
That Aren’t Obvious From The Code
14. Choosing Names
15. Write The Comments First
16. Modifying Existing Code
17. Consistency
18. Code Should Be Obvious
19. Software Trends
20. Designing for Performance
21. Decide What Matters
22. Conclusion
目次
27
1. Introduction
2. The Nature of Complexity
3. Working Code isn’t Enough
4. Modules Should Be Deep
5. Information Hiding (and Leakage)
6. General-Purpose Modules are Deeper
7. Different Layer, Different Abstraction
8. Pull Complexity Downwards
9. Better Together Or Better Apart?
10. Define Errors Out Of Existence
11. Design it Twice
12. Why Write Comments? The Four Excuses
13. Comments Should Describe Things
That Aren’t Obvious From The Code
14. Choosing Names
15. Write The Comments First
16. Modifying Existing Code
17. Consistency
18. Code Should Be Obvious
19. Software Trends
20. Designing for Performance
21. Decide What Matters
22. Conclusion
目次
29
1. Introduction
2. The Nature of Complexity
3. Working Code isn’t Enough
4. Modules Should Be Deep
5. Information Hiding (and Leakage)
6. General-Purpose Modules are Deeper
7. Different Layer, Different Abstraction
8. Pull Complexity Downwards
9. Better Together Or Better Apart?
10. Define Errors Out Of Existence
11. Design it Twice
12. Why Write Comments? The Four Excuses
13. Comments Should Describe Things
That Aren’t Obvious From The Code
14. Choosing Names
15. Write The Comments First
16. Modifying Existing Code
17. Consistency
18. Code Should Be Obvious
19. Software Trends
20. Designing for Performance
21. Decide What Matters
22. Conclusion
目次
34
1. Introduction
2. The Nature of Complexity
3. Working Code isn’t Enough
4. Modules Should Be Deep
5. Information Hiding (and Leakage)
6. General-Purpose Modules are Deeper
7. Different Layer, Different Abstraction
8. Pull Complexity Downwards
9. Better Together Or Better Apart?
10. Define Errors Out Of Existence
11. Design it Twice
12. Why Write Comments? The Four Excuses
13. Comments Should Describe Things
That Aren’t Obvious From The Code
14. Choosing Names
15. Write The Comments First
16. Modifying Existing Code
17. Consistency
18. Code Should Be Obvious
19. Software Trends
20. Designing for Performance
21. Decide What Matters
22. Conclusion
目次
37
1. Introduction
2. The Nature of Complexity
3. Working Code isn’t Enough
4. Modules Should Be Deep
5. Information Hiding (and Leakage)
6. General-Purpose Modules are Deeper
7. Different Layer, Different Abstraction
8. Pull Complexity Downwards
9. Better Together Or Better Apart?
10. Define Errors Out Of Existence
11. Design it Twice
12. Why Write Comments? The Four Excuses
13. Comments Should Describe Things
That Aren’t Obvious From The Code
14. Choosing Names
15. Write The Comments First
16. Modifying Existing Code
17. Consistency
18. Code Should Be Obvious
19. Software Trends
20. Designing for Performance
21. Decide What Matters
22. Conclusion
Slide 38
Slide 38 text
同じとこに実装する? or 分けて実装する?
Chap 9
● 重要なのは複雑性の軽減
● 細分化すればするほど
○ すべてのパーツの把握が困難に
○ パーツをつなぎ合わせるコードが増える
● パーツが本当に独立しているのであれば分割は良いこと
○ 開発者は1つのコンポーネントに集中できる
38
目次
42
1. Introduction
2. The Nature of Complexity
3. Working Code isn’t Enough
4. Modules Should Be Deep
5. Information Hiding (and Leakage)
6. General-Purpose Modules are Deeper
7. Different Layer, Different Abstraction
8. Pull Complexity Downwards
9. Better Together Or Better Apart?
10. Define Errors Out Of Existence
11. Design it Twice
12. Why Write Comments? The Four Excuses
13. Comments Should Describe Things
That Aren’t Obvious From The Code
14. Choosing Names
15. Write The Comments First
16. Modifying Existing Code
17. Consistency
18. Code Should Be Obvious
19. Software Trends
20. Designing for Performance
21. Decide What Matters
22. Conclusion
目次
48
1. Introduction
2. The Nature of Complexity
3. Working Code isn’t Enough
4. Modules Should Be Deep
5. Information Hiding (and Leakage)
6. General-Purpose Modules are Deeper
7. Different Layer, Different Abstraction
8. Pull Complexity Downwards
9. Better Together Or Better Apart?
10. Define Errors Out Of Existence
11. Design it Twice
12. Why Write Comments? The Four Excuses
13. Comments Should Describe Things
That Aren’t Obvious From The Code
14. Choosing Names
15. Write The Comments First
16. Modifying Existing Code
17. Consistency
18. Code Should Be Obvious
19. Software Trends
20. Designing for Performance
21. Decide What Matters
22. Conclusion
Slide 49
Slide 49 text
Design it Twice
Chap 11
● ソフトウェアの設計はそもそも難しい
● 例:テキストエディアの実装
○ 行指向?
○ キャラクター指向?
○ 文字列指向?
● オプションを複数設計して、長所・短所をリストアップして
選んだほうが上手くいくことが多い
49
Slide 50
Slide 50 text
目次
50
1. Introduction
2. The Nature of Complexity
3. Working Code isn’t Enough
4. Modules Should Be Deep
5. Information Hiding (and Leakage)
6. General-Purpose Modules are Deeper
7. Different Layer, Different Abstraction
8. Pull Complexity Downwards
9. Better Together Or Better Apart?
10. Define Errors Out Of Existence
11. Design it Twice
12. Why Write Comments? The Four Excuses
13. Comments Should Describe Things
That Aren’t Obvious From The Code
14. Choosing Names
15. Write The Comments First
16. Modifying Existing Code
17. Consistency
18. Code Should Be Obvious
19. Software Trends
20. Designing for Performance
21. Decide What Matters
22. Conclusion
Slide 51
Slide 51 text
なぜコメントを書くのか?
Chap 12
● コメント・ドキュメントには抽象化という役割がある
● コメントを書かない4つの言い訳
1. Good Code is self-documenting
2. コメントを書く時間がない
3. コメントが古くなってむしろミスリード
4. これまで見てきたコメントは無価値だった
51
Slide 52
Slide 52 text
1. Good Code is self-documenting
Chap 12
● 良いコードなら、コメントはいらないでしょ というアイデア
○ 著者いわく「アイスクリームは健康に良い」という噂と同じぐらい神話
● クラスのIFは、型や変数などのシグネチャ以外を表現できない
○ メソッドの動作や、結果の意味、設計の決定根拠など
コードだけでは表現できないものは多い
● そもそもコメントは抽象化の基本
○ 抽象化の目的は複雑さの隠蔽
52
Slide 53
Slide 53 text
2. コメントを書く時間がない
Chap 12
● ソフトウェアプロジェクトの多くは時間に追われている
○ 新機能の開発が優先され、
ドキュメントの優先度が下がるとドキュメントがない状態につながる
53
目次
57
1. Introduction
2. The Nature of Complexity
3. Working Code isn’t Enough
4. Modules Should Be Deep
5. Information Hiding (and Leakage)
6. General-Purpose Modules are Deeper
7. Different Layer, Different Abstraction
8. Pull Complexity Downwards
9. Better Together Or Better Apart?
10. Define Errors Out Of Existence
11. Design it Twice
12. Why Write Comments? The Four Excuses
13. Comments Should Describe Things
That Aren’t Obvious From The Code
14. Choosing Names
15. Write The Comments First
16. Modifying Existing Code
17. Consistency
18. Code Should Be Obvious
19. Software Trends
20. Designing for Performance
21. Decide What Matters
22. Conclusion
目次
60
1. Introduction
2. The Nature of Complexity
3. Working Code isn’t Enough
4. Modules Should Be Deep
5. Information Hiding (and Leakage)
6. General-Purpose Modules are Deeper
7. Different Layer, Different Abstraction
8. Pull Complexity Downwards
9. Better Together Or Better Apart?
10. Define Errors Out Of Existence
11. Design it Twice
12. Why Write Comments? The Four Excuses
13. Comments Should Describe Things
That Aren’t Obvious From The Code
14. Choosing Names
15. Write The Comments First
16. Modifying Existing Code
17. Consistency
18. Code Should Be Obvious
19. Software Trends
20. Designing for Performance
21. Decide What Matters
22. Conclusion
目次
64
1. Introduction
2. The Nature of Complexity
3. Working Code isn’t Enough
4. Modules Should Be Deep
5. Information Hiding (and Leakage)
6. General-Purpose Modules are Deeper
7. Different Layer, Different Abstraction
8. Pull Complexity Downwards
9. Better Together Or Better Apart?
10. Define Errors Out Of Existence
11. Design it Twice
12. Why Write Comments? The Four Excuses
13. Comments Should Describe Things
That Aren’t Obvious From The Code
14. Choosing Names
15. Write The Comments First
16. Modifying Existing Code
17. Consistency
18. Code Should Be Obvious
19. Software Trends
20. Designing for Performance
21. Decide What Matters
22. Conclusion
Comment First Process
Chap 15
● 次の順でコメントを書いていく
a. 新しいクラスではIFのコメントを書く
b. 次に重要な Public メソッド のコメントとシグネチャを書く
c. メソッド本体を実装する
d. 実装中に追加メソッドや変数の必要性に気づいたら
先にコメントから書いていく
70
Slide 71
Slide 71 text
目次
71
1. Introduction
2. The Nature of Complexity
3. Working Code isn’t Enough
4. Modules Should Be Deep
5. Information Hiding (and Leakage)
6. General-Purpose Modules are Deeper
7. Different Layer, Different Abstraction
8. Pull Complexity Downwards
9. Better Together Or Better Apart?
10. Define Errors Out Of Existence
11. Design it Twice
12. Why Write Comments? The Four Excuses
13. Comments Should Describe Things
That Aren’t Obvious From The Code
14. Choosing Names
15. Write The Comments First
16. Modifying Existing Code
17. Consistency
18. Code Should Be Obvious
19. Software Trends
20. Designing for Performance
21. Decide What Matters
22. Conclusion
Slide 72
Slide 72 text
既存コードの保守・メンテナンスにおいて…
Chap 16
● 戦略的であり続ける
○ 通常、開発者が既存コードに手をいれる場合は戦術的になる
「タスクを完了させるための最小な変更は何だろう?」
72
目次
77
1. Introduction
2. The Nature of Complexity
3. Working Code isn’t Enough
4. Modules Should Be Deep
5. Information Hiding (and Leakage)
6. General-Purpose Modules are Deeper
7. Different Layer, Different Abstraction
8. Pull Complexity Downwards
9. Better Together Or Better Apart?
10. Define Errors Out Of Existence
11. Design it Twice
12. Why Write Comments? The Four Excuses
13. Comments Should Describe Things
That Aren’t Obvious From The Code
14. Choosing Names
15. Write The Comments First
16. Modifying Existing Code
17. Consistency
18. Code Should Be Obvious
19. Software Trends
20. Designing for Performance
21. Decide What Matters
22. Conclusion
目次
79
1. Introduction
2. The Nature of Complexity
3. Working Code isn’t Enough
4. Modules Should Be Deep
5. Information Hiding (and Leakage)
6. General-Purpose Modules are Deeper
7. Different Layer, Different Abstraction
8. Pull Complexity Downwards
9. Better Together Or Better Apart?
10. Define Errors Out Of Existence
11. Design it Twice
12. Why Write Comments? The Four Excuses
13. Comments Should Describe Things
That Aren’t Obvious From The Code
14. Choosing Names
15. Write The Comments First
16. Modifying Existing Code
17. Consistency
18. Code Should Be Obvious
19. Software Trends
20. Designing for Performance
21. Decide What Matters
22. Conclusion
Slide 80
Slide 80 text
コードは理解しやすくあるべき
Chap 18
● “理解しやすさ” は読み手が判断する
○ ∴ コードの理解しやすさを判断する良い機会はコードレビュー
80
目次
82
1. Introduction
2. The Nature of Complexity
3. Working Code isn’t Enough
4. Modules Should Be Deep
5. Information Hiding (and Leakage)
6. General-Purpose Modules are Deeper
7. Different Layer, Different Abstraction
8. Pull Complexity Downwards
9. Better Together Or Better Apart?
10. Define Errors Out Of Existence
11. Design it Twice
12. Why Write Comments? The Four Excuses
13. Comments Should Describe Things
That Aren’t Obvious From The Code
14. Choosing Names
15. Write The Comments First
16. Modifying Existing Code
17. Consistency
18. Code Should Be Obvious
19. Software Trends
20. Designing for Performance
21. Decide What Matters
22. Conclusion
目次
84
1. Introduction
2. The Nature of Complexity
3. Working Code isn’t Enough
4. Modules Should Be Deep
5. Information Hiding (and Leakage)
6. General-Purpose Modules are Deeper
7. Different Layer, Different Abstraction
8. Pull Complexity Downwards
9. Better Together Or Better Apart?
10. Define Errors Out Of Existence
11. Design it Twice
12. Why Write Comments? The Four Excuses
13. Comments Should Describe Things
That Aren’t Obvious From The Code
14. Choosing Names
15. Write The Comments First
16. Modifying Existing Code
17. Consistency
18. Code Should Be Obvious
19. Software Trends
20. Designing for Performance
21. Decide What Matters
22. Conclusion