리팩터링
책 리팩터링을 읽으면서 간략 및 스스로의 이래를 위해 글을 써봅니다.
리팩터링 되지 않은 코드를 하나씩 수정해봅시다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// play.json
{
"hamlet" : {"name": "Hamlet", "type": "tragedy"},
"as-like": {"name": "As You Like It", "type": "comedy"},
"othello": {"name": "Othello", "type": "tragedy"}
}
// invoice.json
{
"customer": "BigCo",
"performances": [
{
"playID" : "hamlet",
"audience": 55
},
{
"playID" : "as-like",
"audience": 35
},
{
"playID" : "othello",
"audience": 40
}
]
}
1