A code kata workshop which I was supposed to hold on the Namics Conference 2013 in Innsbruck toghether with Michael Wegener. Sadly I couldn't make it so one of my colleagues Philip Althaus jumped in for me...
5. CODE KATAS
EXERCICES WHICH HELP PROGRAMMERS
HONE THEIR SKILLS THROUGH
PRACTICE AND REPETITION
do it in pairs
SIMPLE PROBLEM TO SOLVE
THAT GETS HARDER WITH RESTRICTIONS
there is no right solution, it has not to be finished
6. WHY BOTHER?
LEARNING OUTSIDE THE CURRENT PROJECT
experiment on a playground
GETTING INSTANT FEEDBACK
discuss your approaches
SEE HOW OTHERS DO
THE SAME THING DIFFERENT
there is no right solution
7. RESTRICITONS & WAYS
PROBLEM
TO SOLVE
NO
CONDITIONALS
TIME TO
GREEN
GOOD / BAD
PROGRAMMER
…
NO ARRAYS
use
polymorphism
write small methods
make small changes
write better tests
use
data structures
10. GAME RULES
10 FRAMES / 2 THROWS PER FRAME
10 pins to knock down
SPARE – ALL 10 PINS IN 2 THROWS
bonus – no. of pins knocked down in next throw
STRIKE– ALL 10 PINS IN 1 THROW
bonus – no. of pins knocked down in next 2 throws
10th FRAME – ADDITIONAL BALLS ON
SPARE OR STRIKE
no more than 3 balls total
4
1
5
5
4
14
6
29
5
49
60
1
0
61
7
77
6
97
117
2
133
6
11. REQUIREMENTS
WRITE A CLASS NAMED GAME
it has 2 methods
ROLL(PINS : INT)
CALLED EACH TIME PLAYER ROLLS A BALL
argument is number of pins knocked down
SCORE()
CALLED AT THE END OF THE GAME
returns the total score of that game
Game
+ roll( pins : int )
+ score()
12. TESTS FIRST
GUTTER GAME
no pins where knocked down
ALL ONES
every throw knocked down one pin
ONE SPARE
game with one spare
ONE STRIKE
game with one strike
15. CODE KATAS
REUSE A SIMPLE KATA OVER AND OVER
play with different restrictions
USE TEST-DRIVEN-DEVELOPMENT
as a supportive technique
LEARN YOUR STRENGTHS AND WEAKNESSES
and those of others
RECOGNIZE THAT DIFFICULT TASKS
WILL GET EASIER AFTER A WHILE
you need to struggle in order to improve
Übernahme PhilipKurzeErläuterungwiewir’s in Zürichmachen, Stichworte: Regelmässig, guteTeilnehmerzahl, kurzeProblemstellungen, Pairprogramming, Spass, ReviewErklärung der Aufgabenstellung, imNormalfallzuzweit, im Workshop aberim Plenum wegenbegrenzterZeit
The game consists of 10 frames as shown above. In each frame the player hastwo opportunities to knock down 10 pins. The score for the frame is the totalnumber of pins knocked down, plus bonuses for strikes and spares.A spare is when the player knocks down all 10 pins in two tries. The bonus forthat frame is the number of pins knocked down by the next roll. So in frame 3above, the score is 10 (the total number knocked down) plus a bonus of 5 (thenumber of pins knocked down on the next roll.)A strike is when the player knocks down all 10 pins on his first try. The bonusfor that frame is the value of the next two balls rolled.In the tenth frame a player who rolls a spare or strike is allowed to roll the extraballs to complete the frame. However no more than three balls can be rolled intenth frame.
Philip: Erklären das der Workshop im Plenum gehaltenwird -> Michi Coded, Plenum sagt was ermachen mussThe game consists of 10 frames as shown above. In each frame the player hastwo opportunities to knock down 10 pins. The score for the frame is the totalnumber of pins knocked down, plus bonuses for strikes and spares.A spare is when the player knocks down all 10 pins in two tries. The bonus forthat frame is the number of pins knocked down by the next roll. So in frame 3above, the score is 10 (the total number knocked down) plus a bonus of 5 (thenumber of pins knocked down on the next roll.)A strike is when the player knocks down all 10 pins on his first try. The bonusfor that frame is the value of the next two balls rolled.In the tenth frame a player who rolls a spare or strike is allowed to roll the extraballs to complete the frame. However no more than three balls can be rolled intenth frame.
Philip: Erklären das der Workshop im Plenum gehaltenwird -> Michi Coded, Plenum sagt was ermachen mussThe game consists of 10 frames as shown above. In each frame the player hastwo opportunities to knock down 10 pins. The score for the frame is the totalnumber of pins knocked down, plus bonuses for strikes and spares.A spare is when the player knocks down all 10 pins in two tries. The bonus forthat frame is the number of pins knocked down by the next roll. So in frame 3above, the score is 10 (the total number knocked down) plus a bonus of 5 (thenumber of pins knocked down on the next roll.)A strike is when the player knocks down all 10 pins on his first try. The bonusfor that frame is the value of the next two balls rolled.In the tenth frame a player who rolls a spare or strike is allowed to roll the extraballs to complete the frame. However no more than three balls can be rolled intenth frame.