- 全員レビューできた
- ちゃんとみんなやってきた
- 定期的にできた
- 言いやすい雰囲気だった
- 目的がはっきりして取り組めた
- 毎日勉強した
- 意識が常に向いた(モチベーション)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Cafe { | |
def buyCoffee(cc: CreditCard): Coffee = { | |
val cup = new Coffee() | |
cc.charge(cup.price) // 副作用 | |
cup | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 関数型ソリューション | |
class Cafe { | |
def buyCoffee(cc: CreditCard): (Coffee, Charge) = { | |
val cup = new Coffee() | |
(cup, cup.price) // charge作成を切り離す | |
} | |
} | |
/** | |
* CreditCardとAmountを持つ. |