57
Organise a Python Code Dojo! Nicholas H.Tollervey [email protected] Who am I? I was a musician and teacher before becoming a developer. This talk is introductory in nature Please interrupt and ask questions Tell you about experiences organising the London Python Code Dojo Encourage *you* to organise a dojo...

Organise a Code Dojo!

Embed Size (px)

DESCRIPTION

Slides from my Europython2010 presentation on our experiences running the London Python Code Dojo.

Citation preview

Page 1: Organise a Code Dojo!

Organise a Python Code Dojo!

Nicholas [email protected]

Who am I? I was a musician and teacher before becoming a developer.

This talk is introductory in nature

Please interrupt and ask questions

Tell you about experiences organising the London Python Code Dojo

Encourage *you* to organise a dojo...

Page 2: Organise a Code Dojo!

Organise a what..?(http://codingdojo.org/)

What is a code-dojo?

Dojo = safe place to practice. A place to make mistakes and learn.

Terminology borrowed from martial arts / Zen Buddhism.

Page 3: Organise a Code Dojo!

Invented here

http://www.flickr.com/photos/anirudhkoul/3483995761/

Started by French dudes in Paris around December 2004

Page 4: Organise a Code Dojo!

“Acquiring coding skills should be a continuous

process...”http://codingdojo.org/

Very simple philosophy.

I’d add that improving existing skills is also important.

Page 5: Organise a Code Dojo!

Code Dojo = Deliberate Practice

http://www.flickr.com/photos/19884852@N00/318274014/

To improve one needs to practice...

Page 6: Organise a Code Dojo!

These are old ideas...

Page 7: Organise a Code Dojo!

Socrates (469-399 BCE)

ὁ δὲ ἀνεξέταστος βίος οὐ βιωτὸς ἀνθρώπῳ

http://en.wikiquote.org/wiki/File:Socrates_Louvre.jpg

The father of Western philosophy... (2500 years ago)

Page 8: Organise a Code Dojo!

The unexamined life is not worth living.

Socrates (469-399 BCE)http://en.wikiquote.org/wiki/File:Socrates_Louvre.jpg

i.e. it’s good to be in a continuous process of examination and re-examination

Page 9: Organise a Code Dojo!

Πολυμαθίη νόον ἔχειν οὐ διδάσκει

Heraclitus (c.535 - 475 BCE)http://en.wikiquote.org/wiki/File:Heraclitus,_Johannes_Moreelse.jpg

The original grumpy old man of ancient Greek philosophy...

Page 10: Organise a Code Dojo!

Heraclitus (c.535 - 475 BCE)

Much learning does not teach understanding.

http://en.wikiquote.org/wiki/File:Heraclitus,_Johannes_Moreelse.jpg

in other words... don’t just read the book. Go *do* something (practice!)

Page 11: Organise a Code Dojo!

Parisian Dojo Rules

(not to scale)

2mins: organise next dojo

30mins: retrospective on last dojo

10mins: decide the topic for this dojo

40mins: code (either “prepared” or “randori” kata)

10mins: half time break

40mins: code

dojo

start

end

What happens at a dojo?

codingdojo.org sets out detailed rules for timing and conduct...

Page 12: Organise a Code Dojo!

Kata..?http://www.flickr.com/photos/renfield/351557228/

Kata - martial arts term meaning “forms”

pre-specified / choreographed steps to be practiced again and again. Improves muscle memory.

Page 13: Organise a Code Dojo!

Also think scales, arpeggios or Etude that musicians practice (again and again).

Can be graded in difficulty and focus on particular “aspects” of a practice.

Important to practice correctly - reflect with the aim of autonomy.

In the code-dojo context we mean small, self-contained programming puzzles.

Two mechanisms for doing Kata in the dojo...

Page 14: Organise a Code Dojo!

Prepared Kata

• A presenter shows how to solve the problem using TDD and BabySteps™

• Each step must make sense to everyone present

• Only interrupt if you don’t understand what’s going on

http://www.flickr.com/photos/foundphotoslj/466713478/

Page 15: Organise a Code Dojo!

Randori Katapilot

co-pilot

• Public pair programming using TDD

• Each pair has a time slot

• At the end the pilot returns to the audience, the co-pilot becomes the new pilot and a new co-pilot volunteers from the audience

happy to volunteer

Randori means “chaos taking” - something like freestyle.

Audience mustn’t interrupt - only co-pilot.

Pilot gives a running commentary of their thought process.

Page 16: Organise a Code Dojo!

What happened in London..?

We’ve learned about the theory. What happened in practice..?

Page 17: Organise a Code Dojo!

!"#$

#"%"

Last August pub meet to organise a “randori” style dojo.

Decided create a graphical representation of a social network based on data from Twitter.

Page 18: Organise a Code Dojo!

Geeks actually socialising!

Coding fuel

Fry-IT provided free pizza and beer + location.

Page 19: Organise a Code Dojo!

Code

Good turnout

About 25 people turned up.

The rule for a time slot was 10 minutes or a passing unit test for each pair.

This worked quite well...

Page 20: Organise a Code Dojo!

But we didn’t know what we were doing and didn’t

stick to the rules!

Page 21: Organise a Code Dojo!

We only had Emacs or Vim available...

...and didn’t have a standard keyboard.

The Twitter based kata sucked (too complex) :-(

Only 6-7 people got a chance to pilot.

vs

Things we should have thought of in advance... :-(

Page 22: Organise a Code Dojo!

We got it to work!

Page 23: Organise a Code Dojo!

Other stuff that wasn’t supposed to happen...

Page 24: Organise a Code Dojo!

Spontaneous applause for working code

Audience participation

Lots of discussion & debate

A generally noisy time

The original rules for a code-dojo are formal and limit the possibility of the audience from disturbing the pilot and co-pilot.

Page 25: Organise a Code Dojo!

(actually, that was good stuff)In the discussion at the end we actually thought interaction was a positive aspect of the evening.

We continued doing Randori based dojo until...

Page 26: Organise a Code Dojo!

Dave’s great idea...

I want to do a presentation and get your

feedback...

Dave had a great idea.

Page 27: Organise a Code Dojo!

Ciarán’s great idea...

Wouldn’t it be great if we split into small groups to code

together..?

Lightning struck twice

Ciaran had a good idea too.

He didn’t like the fact that only 6-7 people got a chance to code.

Also, some of us didn’t want to code in front of everyone but were happy to code in smaller groups.

Page 28: Organise a Code Dojo!

Two new dojo formats!

Page 29: Organise a Code Dojo!

#1 Show and Tell DojoRene setting up a demo for PyGame...

Page 30: Organise a Code Dojo!

More like a seminar than presentation.

Interrupt, ask questions, debate, code along, point out problems and generally don’t just sit there...

Page 31: Organise a Code Dojo!

Participation expected

Page 32: Organise a Code Dojo!

#2 Team Dojo

Page 33: Organise a Code Dojo!

&+

( )

=A bit like the classic TV programme “The Great Egg Race” or Scrapheap challenge... teams complete a task with Python.

Page 34: Organise a Code Dojo!

Suggest / vote on a topicTask ideas written on the white-board during the pizza and beer bit at the start.

We then vote and split into teams.

Page 35: Organise a Code Dojo!

Teams do the same taskThis takes about 1.5 hours.

Page 36: Organise a Code Dojo!

Show, tell, review & questionsThis takes about 1/2 hour and is usually the best part of the evening (for me).

Often the task will have been solved in some interesting ways or in ways *you* might not have imagined.

Also, presenting and explaining code as well as telling us about design decisions is a good thing to practice.

Page 37: Organise a Code Dojo!

Long term-projects...After Christmas the London dojo decided to write an “old skool” text Adventure game. Each element being a task for the dojo.

Page 38: Organise a Code Dojo!

Select a topic from project

Groups solve the same topic

Demo, review and evaluate

Bless a “winner” as start for next time

The general modus operandi.

“Refactoring” dojo using the Randori method was a disaster (boring as hell).

Page 39: Organise a Code Dojo!

Adventure TopicsCreate a game world

Represent game state

Make a parser

Generate puzzles

Multi-user or client / server

Here’s what we did.

Page 40: Organise a Code Dojo!

telnet gautier.fry-it.com 2300

Try my MSUD! (Multi-Single User

Dungeon)

So, the end result after several dojos was a working adventure game. Actually Gautier has made it available to play on the Internet... go try it! It’s fun!

Page 41: Organise a Code Dojo!

Gautier’s server :-)

http://www.flickr.com/photos/7969902@N07/511103951/

telnet gautier.fry-it.com 2300Where is French Polynesia? This is a picture of the French army blowing it up in 1970. Licorne 2.

Page 42: Organise a Code Dojo!

In the dojo we...

• Teach one another

• Explain and present code to one another

• Explore each other’s solutions

• Work together

• Build a community

The educational benefits of taking part in a these sorts of Dojo are pretty obvious (I hope).

You get to practice all sorts of things...

Not the original dojo format.

We “forked” the concept - stole the ideas we liked and adapted it to our own group’s dynamics...

Page 43: Organise a Code Dojo!

Dynamism... what a dynamic bunch we all are.

Actually, I missed off one of the most important outcomes...

Page 44: Organise a Code Dojo!

It’s FUN!It’s easier to learn when you’re having a good time.

Page 45: Organise a Code Dojo!

And now a word from our sponsors...

Other considerations for making the dojo a success...

Community building was an aim in addition to learning

Page 46: Organise a Code Dojo!

Nerd bait

Nerds

The pizza and beer = important means of community building.

Share “war” stories, demo stuff and generally have a good time.

Page 47: Organise a Code Dojo!

It’s just like IRC but you’re actually IRL!

People relax and look forward to the coding aspect of the dojo.

For open source developers community is important.

Page 48: Organise a Code Dojo!

More nerd bait...We also spoke to O’Reilly who provide us with a book every month. You might have noticed we wear name-badges. Not only because we can never remember each other’s names but also because it makes it easy to do a “prize draw” at the end of the evening.

Page 49: Organise a Code Dojo!

and finally...

Page 50: Organise a Code Dojo!

mmMMmm... backwards talk rubbish do I

How to be a Jedi Hacker

A personal opinion - people like me who want to learn and improve are often looking for teachers - but beware people who offer themselves as gurus, who promote a “system” or offer pithy aphorisms.

Page 51: Organise a Code Dojo!

WTF?

To be an über-Hacker is to “grok” the source completely

It’s tempting to be impressed and follow / listen to them

I encourage you to be cynical and ask questions of them (just like we do of each other in the dojo)

Learn to practice learning (rather than following) by learning in a dojo - yeah I know that’s a pithy aphorism. Bite me! ;-)

Page 52: Organise a Code Dojo!

ἓν οἶδα ὅτι οὐδὲν οἶδα

Socrates (469-399 BCE)http://en.wikiquote.org/wiki/File:Socrates_Louvre.jpg

I’m with Socrates...

Page 53: Organise a Code Dojo!

The only real wisdom is knowing you know

nothing.

Socrates (469-399 BCE)http://en.wikiquote.org/wiki/File:Socrates_Louvre.jpg

don’t just blindly follow what other people say... make up your own mind.

Page 54: Organise a Code Dojo!

Just get stuck in...

Please...

Page 55: Organise a Code Dojo!

Organise a dojo!

Adapt it to your needs, experiment, expect to get things wrong but please HAVE FUN, learn, practice and improve!

Page 56: Organise a Code Dojo!

If you’re ever in London come along and say hi!

I advertise it on the Python-UK mailing list. I’ll eventually get round to doing a website.

Page 57: Organise a Code Dojo!

Questions..?

Binary beer bottles :-)