Refactoring to Functional Programming in Java - Live-Coding Kata - 'Yatzi', part 2

preview_player
Показать описание

Among the topics we'll discuss:
- Functional Programming Techniques in Java : Stream API
- Lambdas, Method references, compact code
- Pragmatic coding in Java
- Identifying and designing by the Single Responsibility Principle (SRP)
- Safe Refactoring techniques
- Effective usage of IntelliJ editor, with lots of tips and tricks
- Mutable vs Immutable data structures
- and lots of fun.

This commit:

Рекомендации по теме
Комментарии
Автор

This was an excellent video - love your enthusiasm :)

smsie
Автор

Notes:
1:04:20 - boundary objects that test invariants are alright to keep ugly, so that you keep the domain logic clean

thatoneuser
Автор

Hi Victor!
Just finished watching your 2 videos.

I was wondering. What do you think of my solution for the 'fullHouse' method?
How can I improve it?

public static int fullHouse(DiceHand diceHand) {

boolean threeOfAKind = false;
boolean pair = false;

for (Map.Entry<Integer, Long> entry : {
if (entry.getValue() ==2){
pair = true;
}
if(entry.getValue()==3){
threeOfAKind= true;
}}

if(pair&&threeOfAKind)
{
return score_pair(diceHand) + nOfAKind(diceHand, 3);
}
return 0;
}

Thanks in advance!

theolivapassport
welcome to shbcf.ru