1 of 16

Coding Dojo

GDG Mercer University

2 of 16

A Coding Dojo is:

a special way to practice that emphasizes certain skills that are hard for programmers

to acquire and easy for them to lose.

3 of 16

Those skills include

  • working together as a team,
  • the disciplines of Test Driven Development and Refactoring,
  • good design skills

Coding Dojo Handbook

4 of 16

Major Goal

Use challenges to practice these skills.

Deliberate practice.

5 of 16

Schedule

  • Introduction and retrospective (10 to 15 minutes, longer than usual today)
  • Select a dojo style and kata
  • Code
  • Retrospective

6 of 16

Approaches to Dojo

  • Whole group works together
  • Pairs work together
  • One person shows a solution

We'll work together as a group: Randori.

7 of 16

Randori

A pair at the front:

  • driver on the keyboard
  • navigator helping the driver

Rotate every 5 minutes:

  • navigator joins group
  • driver becomes navigator
  • new person becomes driver

8 of 16

Other participants

Sensei: May ask questions, but not give answers.

Others: May search for answers but may not write code independently.

9 of 16

Randori Rules

  1. if you have the keyboard, you get to decide what to type
  2. if you have the keyboard and you don’t know what to type, ask for help
  3. if you are asked for help, kindly respond to the best of your ability
  4. if you are not asked, but you see an opportunity for improvement or learning, choose an appropriate moment to mention it.

Coding Dojo Handbook

10 of 16

Test Driven Development

Robert Martin’s “3 rules”of TDD:

  1. You are not allowed to write any production code unless it is to make a failing unit test pass.
  2. You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures.

11 of 16

TDD cont.

  • You are not allowed to write any more production code than is sufficient to pass the one failing unit test.

12 of 16

Red -> Green -> Refactor

13 of 16

Today's Tools

Pick either:

  • Python with Unittest
  • Cyber-dojo.com

14 of 16

Kata

The challenges in the dojo.

Intentionally simple to allow focus on the technique.

15 of 16

Today's Kata

FizzBuzz

16 of 16

Many Thanks to:

The Coding Dojo Handbook by Emily Bache

codingdojo.org