Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Coding Dojo: 
Mars Rover 
Oct. 2014 
Peter Kofler, ‘Code Cop’ 
@codecopkofler 
www.code-cop.org 
Copyright Peter Kofler, l...
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Peter Kofler 
• Ph.D. (Appl. Math.) 
• Professional Software 
Devel...
Coding Dojo? 
Expectations?
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Coding Dojo Mindset 
● Safe place outside 
work 
● We are here to l...
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Two Basic Rules 
● Collaborative = Pair Programming 
● “Randori“ (p...
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
(Maybe Some) Constraints 
● Challenges during a dojo or coderetreat...
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Dojo Structure 
● Introduction 15' 
● Coding 45' 
● Interim (Retros...
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Assignment
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Mars Rover 
● Develop an API that moves a rover around on a grid. 
...
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Mars Rover Example 
● The rover is on a 
100x100 grid 
● at locatio...
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Remember the Rules!
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Pair Programming & TDD 
● regular Pair Programming 
– do not talk f...
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
With a Constraint
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
“Yes, and ...“ 
● When working in pairs none of the pairs 
is allow...
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
“Yes, and ...“ Rules 
● improve existing code of the other 
● can n...
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Prepare 
● Find a pair. 
● Choose a programming language. 
● Set up...
Don't Focus on 
Getting it Done. 
F0cus on Doing 
It Perfectly.
→ Practice
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Short Closing Circle 
● How did it work out? 
● How do you feel? 
●...
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Full Closing Circle 
● What did you learn today? 
● What surprised ...
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Global Day of Code Retreat 
● A world-wide event celebrating passio...
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Peter Kofler 
@codecopkofler 
www.code-cop.org 
Game by 
Adrian Bol...
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
CC Images 
● Rover Selfie http://www.flickr.com/photos/gsfc/7971341...
Upcoming SlideShare
Loading in …5
×

Coding Dojo: Mars Rover (2014)

1,480 views

Published on

Published in: Technology
  • Be the first to comment

Coding Dojo: Mars Rover (2014)

  1. 1. Coding Dojo: Mars Rover Oct. 2014 Peter Kofler, ‘Code Cop’ @codecopkofler www.code-cop.org Copyright Peter Kofler, licensed under CC-BY.
  2. 2. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Peter Kofler • Ph.D. (Appl. Math.) • Professional Software Developer for 15 years • “fanatic about code quality” • I help development teams
  3. 3. Coding Dojo? Expectations?
  4. 4. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Coding Dojo Mindset ● Safe place outside work ● We are here to learn ● Need to slow down ● Focus on doing it right ● Collaborative Game
  5. 5. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Two Basic Rules ● Collaborative = Pair Programming ● “Randori“ (pairing on the projector) ● or programming in pairs ● Test Driven Development ● think about tests ● write the test first
  6. 6. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY (Maybe Some) Constraints ● Challenges during a dojo or coderetreat. ● Moving to the extreme is a way of learning ● Examples ● Missing Tool (No Mouse, …) ● Missing Feature (No IFs, …)
  7. 7. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Dojo Structure ● Introduction 15' ● Coding 45' ● Interim (Retrospective) 15' ● Break 10' ● Coding 45' ● Retrospective 15'
  8. 8. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Assignment
  9. 9. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Mars Rover ● Develop an API that moves a rover around on a grid. ● You are given the initial starting point (x,y) of a rover and the direction ('N','S','E','W') it is facing. ● The rover receives a character array of commands. ● Move the rover forward/backward ('f','b'). ● Turn the rover left/right ('l','r'). ● Wrap the grid. (Planets are spheres after all.) ● Detect obstacles before each move to a new square. If a sequence of commands encounters an obstacle, the rover moves up to the last possible point and reports obstacle.
  10. 10. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Mars Rover Example ● The rover is on a 100x100 grid ● at location (0, 0), ● facing "N"ORTH. ● The rover is given commands "ffrff" ● and should end up at (2, 2). r f f f f (0,0) N (2,2)
  11. 11. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Remember the Rules!
  12. 12. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Pair Programming & TDD ● regular Pair Programming – do not talk for too long – do not interrupt the other – no “keyboard hugging“ ● use TDD (or at least “sort of” TDD) – write a test before you write code – refactor mercilessly – no debugger
  13. 13. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY With a Constraint
  14. 14. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY “Yes, and ...“ ● When working in pairs none of the pairs is allowed to delete the code of the other person. ● We are looking for a common solution, that both of the pairs will agree. ● Learn to build on top of the ideas already presented.
  15. 15. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY “Yes, and ...“ Rules ● improve existing code of the other ● can not delete code of the other ● whenever one tries to delete code, say: “You should improve the existing one. Please go back and say Yes, and… I will do…” ● Can not be angry on request of not deleting code. ● Only unused code can be deleted. ● Both must agree that the code can be deleted.
  16. 16. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Prepare ● Find a pair. ● Choose a programming language. ● Set up the environment. ● Create new project. ● Add testing framework. ● Check requirements. ● Implement Mars Rover.
  17. 17. Don't Focus on Getting it Done. F0cus on Doing It Perfectly.
  18. 18. → Practice
  19. 19. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Short Closing Circle ● How did it work out? ● How do you feel? ● What did you learn and want to share with the group?
  20. 20. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Full Closing Circle ● What did you learn today? ● What surprised you today? ● What will you do differently in the future?
  21. 21. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Global Day of Code Retreat ● A world-wide event celebrating passion and software craftsmanship. ● GDCR 2014: 15th November ● Follow #GDCR14 http://globalday.coderetreat.org/
  22. 22. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Peter Kofler @codecopkofler www.code-cop.org Game by Adrian Bolboaca @adibolb http://blog.adrianbolboaca.ro/2013/12/pair-programming-game-yes-and/
  23. 23. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY CC Images ● Rover Selfie http://www.flickr.com/photos/gsfc/7971341456 ● Dojo http://www.flickr.com/photos/49715404@N00/3267627038/ ● Todos http://www.flickr.com/photos/kylesteeddesign/3724074594/ ● Curiosity http://www.flickr.com/photos/mendhak/8162305237 ● Rule http://www.flickr.com/photos/phunk/4188827473 ● Model http://www.flickr.com/photos/eldave/8430367749 ● Wants you http://www.flickr.com/photos/shutter/105497713/

×