Global Day of Code Retreat 2012: Munich Edition

Global Day of Code Retreat 2012: Munich Edition

The slides I have used during the facilitation of the code retreat at E.S.R. Labs.

A5a5cadf1ec1a7781c109f9bc7b37028?s=128

Sebastian Benz

December 08, 2012
Tweet

Transcript

  1. Code Retreat Munich Sebastian Benz (@sebabenz) Sonntag, 9. Dezember 12

  2. #gdcr12 Sonntag, 9. Dezember 12

  3. Schedule 08.15 - 08.45am: Arrival 08.45 - 09.00am: Introduction 09.00

    - 09.45am: Sessions #1 10.00 - 10.45am: Sessions #2 11.00 - 11.45am: Sessions #3 12.00 - 01.30pm: Lunch, socializing 01.30 - 02.15pm: Sessions #4 02.30 - 03.15am: Sessions #5 03.30 - 04.15am: Sessions #6 04.15 - 05.00pm: Closing circle Sonntag, 9. Dezember 12
  4. The point of a code retreat is not to make

    progress on the problem. The point is to write perfect code! Corey Haines Today Sonntag, 9. Dezember 12
  5. Session I: Get to know the problem Sonntag, 9. Dezember

    12
  6. Conway‘s Game of Life Sonntag, 9. Dezember 12

  7. Conway‘s Game of Life Sonntag, 9. Dezember 12

  8. 1. Any live cell with fewer than two live neighbours

    dies, as if caused by under-population. Rules Sonntag, 9. Dezember 12
  9. 1. Any live cell with fewer than two live neighbours

    dies, as if caused by under-population. Rules Sonntag, 9. Dezember 12
  10. 1. Any live cell with fewer than two live neighbours

    dies, as if caused by under-population. Rules Sonntag, 9. Dezember 12
  11. 2. Any live cell with two or three live neighbours

    lives on to the next generation Rules Sonntag, 9. Dezember 12
  12. 2. Any live cell with two or three live neighbours

    lives on to the next generation Rules Sonntag, 9. Dezember 12
  13. 3. Any live cell with more than three live neighbours

    dies, as if by overcrowding. Rules Sonntag, 9. Dezember 12
  14. 3. Any live cell with more than three live neighbours

    dies, as if by overcrowding. Rules Sonntag, 9. Dezember 12
  15. 4. Any dead cell with exactly three live neighbours becomes

    a live cell, as if by reproduction. Rules Sonntag, 9. Dezember 12
  16. 4. Any dead cell with exactly three live neighbours becomes

    a live cell, as if by reproduction. Rules Sonntag, 9. Dezember 12
  17. http://en.wikipedia.org/wiki/Conway's_Game_of_Life Sonntag, 9. Dezember 12

  18. 4 Rules of simple Design Sonntag, 9. Dezember 12

  19. 4 Rules of simple Design - Runs all the tests

    Sonntag, 9. Dezember 12
  20. 4 Rules of simple Design - Runs all the tests

    - Contains no duplications Sonntag, 9. Dezember 12
  21. 4 Rules of simple Design - Runs all the tests

    - Contains no duplications - Expresses the intent of the programmers Sonntag, 9. Dezember 12
  22. 4 Rules of simple Design - Runs all the tests

    - Contains no duplications - Expresses the intent of the programmers - Has no superfluous parts Sonntag, 9. Dezember 12
  23. Session II: Pair Programming Primitive Obsession Sonntag, 9. Dezember 12

  24. TDD Write a failing unit test Make the test pass

    Refactor Sonntag, 9. Dezember 12
  25. Ping-Pong Programming 1. A writes a new test and sees

    that it fails. 2. B implements the code needed to pass the test. 3. B writes the next test and sees that it fails. 4. A implements the code needed to pass the test. Sonntag, 9. Dezember 12
  26. Session III: How often can you commit? Reveal Intent Sonntag,

    9. Dezember 12
  27. Taking Baby Steps 1. Setup a timer for 2 minutes

    interval when you start 2. Write exactly one test - If the timer rings and the test is red then revert and start over. - If the test is green before timer rings then commit 3. Restart timer 4. Refactor - If the timer rings and the refactoring is not complete then revert start over. - If the refactoring is complete before the timer rings then commit 5. Go to step 1 One important note: there can be no discussions in between timers, everything needs to happen within the timeboxes. Sonntag, 9. Dezember 12
  28. Some Git Help Set up repository and working branch 1.

    in the console/terminal: go to your project folder 2. git init → initialize origin/master branch 3. do initial setup (adding references, building project structure, …) 4. commit How to commit 1. git add . → track all the new files of the branch to version control 2. git commit -a -m “commit message” → a = commit all changed files, m = message. The message cannot be missing or be empty. 3. git status → to check if all changes were committed How to revert 1. git reset –hard → revert to the last committed changes on the branch 2. git status → to check if all changes were reverted Sonntag, 9. Dezember 12
  29. www.softwerkskammer.de Sonntag, 9. Dezember 12

  30. Session IV: Mute Evil Programmer Mute evil programmer... Sonntag, 9.

    Dezember 12
  31. Mute Evil Programmer - Ping-pong - one person writes the

    tests, the other person writes the implementation code - Mute - nobody can talk - Find the Loophole - the implementation person purposely writes the wrong algorithm that still makes the tests turn green. Sonntag, 9. Dezember 12
  32. Session V: Tell don’t Ask Tell don’t ask Sonntag, 9.

    Dezember 12
  33. No function should have a return value Sonntag, 9. Dezember

    12
  34. Session VI: Freestyle Give it your best shot Sonntag, 9.

    Dezember 12
  35. Choose your own challenge - No conditionals (no if /

    case) - Verbs instead of Nouns - Object Calisthenics - ... Sonntag, 9. Dezember 12
  36. Object Calisthenics 1. Use only one level of indentation per

    method 2. Don’t use the else keyword 3. Wrap all primitives and strings 4. Use only one dot per line 5. Don’t abbreviate 6. Keep all entities small - 50 lines per class - 4 lines per method 7. Don’t use any classes with more than two instance variables 8. Use first-class collections 9. Don’t use any getters/setters/properties Sonntag, 9. Dezember 12