Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit 7d3963e

Browse files
committed
refactoring
1 parent f35024f commit 7d3963e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

books/refactoring.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,3 +689,13 @@ describe('', () => {
689689
- テストの書きすぎ
690690
- テストコード自体の修正に時間がかかり開発が遅れているなら、書き過ぎの兆候かも
691691
- ただしテスト過多になるケースはほとんどない
692+
693+
## リファクタリングはじめの一歩
694+
695+
### 関数の抽出
696+
697+
- きわめて頻繁に行われるリファクタリング
698+
- 「何」をしているか、つまり**意図**を関数名として分かりやすく示すのが目的
699+
- 「どのように」目的を達成するか、つまり**実装**は気にしない
700+
- 意図がわかりやすくなるなら、コードが例え数行でも躊躇なく実行する
701+
- 関数内に関数が入れ子になっても全然 OK

0 commit comments

Comments
 (0)