Facilitating a mini Code Retreat

Nov 3, 2022

This is a virtual event. We need to make sure that participants have access to a laptop and that they have a working web camera.

We need to put participants into a learning mindset, were our work constraints are left behind and we focus on the practice of writing software.

The agenda is structured for a session that lasts for 4 hours, with a lunch break of 30 minutes. An agenda for a day structured for 8 hours will have a longer lunch break and longer session.

Agenda

  • Welcome participants
  • Group introduction
  • Introduce the hosts of the event and write their name down
  • Read out the important bits of our Code of Conduct
  • Layout the schedule for the rest of the day
  • Have everything written down into a shared space that anyone can access: Miro etc.

Introducing the workshop

  • This is an autodidactic workshop, I am here just to provide guidance
  • Establish learning goals
    • Practice TDD
    • Mentor other developers
    • Try new languages and paradigms
  • Topic: Reduce the Cost of Change in our code
  • Topic: Four Rules of Simple Design
    • Passes al tests
    • Expresses intent: clear, expressive, and consistent
    • No logic duplication
    • Minimal methods, classes, and modules (no superfluous abstractions)
  • Topic: Coderetreat format
    • We shouldn’t try to finish the problem, and why that’s important
    • At the end of the session we will ask people to delete their code and standup. We cannot do this at work :-)
  • Topic: Conway’s Game of Life
  • Encourage participants to have the courage to experiment

Tooling and setup

  • Using VSCode with Live Share extension for live pair programming
  • Using Miro to share the agenda with our participants and to capture feedback from retrospectives
  • Maven to build our project
  • Java 17
  • Starting project here
  • Have a video feed always on where all participants can join
  • Have pairs work in separate huddles via Slack and the facilitator can jump in and out from the pairing session

Test-Driven Development

  • Activity: ask participants to scale their experience with TDD by picking a number between 0 and 5, where 0 is no experience and 5 is “I do it every day religiously”
    • This needs to be done in a safe environment, and should not be questioned

TDD rules

  • Write production code only to pass a failing unit test
  • Write no more of a unit test than sufficient to fail (compilation failures are failures)
  • Write no more production code than necessary to pass the one failing unit test

The TDD Cycle

  • Red: write a failing test
  • Green: write code that makes the test pass (nothing more)
  • Refactor: refactor your code while the test(s) are green
  • Repeat

Pair-Programming

Rules

  • Pay Attention and Be Engaged
  • Program Out Loud
  • Encourage Vulnerability and Discourage Judgement
  • Thicken Your Skin a Little
  • Be Humble and Willing to Try Things
  • Remind Each Other About Standards and Agreements
  • Be a Navigator, Not a Backseat Driver

Styles

  • Driver and navigator
  • Ping pong
  • Strong-style pairing

Coderetreat session rules

  • Do not put time pressure: a visible timer or inform participants of how long the session is

Schedule of the day

  • 11:00 AM getting started
  • 11:05 AM agenda and introductions
  • 11:30 AM First session
  • 12:00 PM First retrospective
  • 12:10 PM Break (including lunch)
  • 12:30 PM Second session
  • 01:00 PM Second retrospective
  • 01:10 PM Break
  • 01:20 PM Third session
  • 01:50 PM Third retrospective
  • 02:00 PM Break
  • 02:10 PM Fourth session
  • 02:40 PM Fourth retrospective
  • 02:50 PM Wrap-up
  • 03:00 PM Goodbyes

Sessions

  • First session: setup and problem introduction
    • People make sure that they have their environments ready
    • Participants make themselves familiar with the Game of Life
    • Make it clear that participants should delete their code after each session
  • Second session: verbs instead of nouns
    • Appropriate data structures around the problem
    • Primitive obsession
    • Verbs instead of nouns: every class name and variable name needs to be a verb (CreatesCellGeneration, AppliesRuleNumberOne)
  • Third session: heavy exploration of abstractions
    • Polymorphism vs boolean flags
    • Explore abstractions and stay away from primitives
  • Fourth session: constraints
    • No if statements
    • No loops
    • Small methods (1 - 5 lines of code)
    • No language primitives
    • TDD as if you meant it
    • Max 2 minutes session

Retrospective

  • Facilitators should facilitate the sessions not lecture the participants
  • Ask questions, let participants discover things on their own
  • Get everyone involved
  • Who found it difficult to delete their code? Why it was difficult?

Closing circle

  • Everyone should answer three simple questions:
    • What, if anything, did you learn today?
    • What, if anything, surprised you today?
    • What, if anything, will you do differently in the future?
  • Ask about feedback about the session

Resources

Tags: javadesign patternclean codetddcode retreat

Archives

  1. February 2024
  2. Maximizing Software Development Productivity: The Power of Flow and Minimizing Interruptions
  3. December 2023
  4. Clean Code in Java: Writing Code that Speaks
  5. Clean Code in Java: A concise guide
  6. Understanding Value Objects in Java: A Brief Guide
  7. August 2023
  8. Consuming RabbitMQ Messages with Clojure: A Step-by-Step Tutorial with Tests
  9. January 2023
  10. Running a Spring Boot service with kubernetes
  11. December 2022
  12. Hosting a PWA with Jekyll and Github pages
  13. November 2022
  14. Global Day of Code Retreat
  15. Facilitating a mini Code Retreat
  16. October 2022
  17. The Curse of Optional
  18. September 2022
  19. Testing Spring Boot Microservices - Presentation
  20. March 2022
  21. TDD Workshop
  22. February 2022
  23. Value Objects in Java
  24. Efficient Java
  25. January 2022
  26. Spring Boot testing - Focus on your changes
  27. Product users - Personas
  28. December 2021
  29. Write code fit for testing
  30. November 2020
  31. Running a Spring Boot app with kubernetes
  32. September 2019
  33. Setup GPG on Mac and sign git repositories
  34. July 2019
  35. Running a Clojure Pedestal application on Raspberry Pi model B revision 2
  36. Clojure from zero to hero (part 3) - First endpoint
  37. Clojure from zero to hero (part 2) - A bit of syntax
  38. June 2019
  39. Clojure from zero to hero (1) - explaining project.clj
  40. Clojure from zero to hero (0) - creating a Pedestal app
  41. November 2017
  42. Introduction to Docker
  43. April 2015
  44. Git micro commits
  45. July 2014
  46. Google Glass Development - setup tools, environment and turn on debugging on Glass
  47. June 2013
  48. How To: Get the rendered HTML of a webpage with Python
  49. Set union of two lists in Python