Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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.

Sebastian Benz

December 08, 2012
Tweet

More Decks by Sebastian Benz

Other Decks in Technology

Transcript

  1. 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
  2. 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
  3. 1. Any live cell with fewer than two live neighbours

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

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

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

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

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

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

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

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

    a live cell, as if by reproduction. Rules Sonntag, 9. Dezember 12
  12. 4 Rules of simple Design - Runs all the tests

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

    - Contains no duplications - Expresses the intent of the programmers Sonntag, 9. Dezember 12
  14. 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
  15. TDD Write a failing unit test Make the test pass

    Refactor Sonntag, 9. Dezember 12
  16. 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
  17. 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
  18. 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
  19. 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
  20. Choose your own challenge - No conditionals (no if /

    case) - Verbs instead of Nouns - Object Calisthenics - ... Sonntag, 9. Dezember 12
  21. 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