Guildford Coding Dojo1

22
Guildford Coding Dojo Basingstoke! Basingstoke!

description

Background slides for first Guildford coding dojo http://www.meetup.com/Guildford-Coding-Dojo/

Transcript of Guildford Coding Dojo1

Page 1: Guildford Coding Dojo1

Guildford Coding DojoGuildford Coding Dojo

Basing

stoke!

Basing

stoke!

Page 2: Guildford Coding Dojo1

First Things FirstFirst Things First

Who are you?

What do you do?

Coding experience

One unusual factoid about yourself

Who are you?

What do you do?

Coding experience

One unusual factoid about yourself

Page 3: Guildford Coding Dojo1

Some DefinitionsSome Definitions

Dojo - “the place of learning the way”Dojo - “the place of learning the way”

Page 4: Guildford Coding Dojo1

Some DefinitionsSome Definitions

Kata - “way of doing”

A choreographed series of motions designed to teach a particular skill or pattern

Kata - “way of doing”

A choreographed series of motions designed to teach a particular skill or pattern

Page 5: Guildford Coding Dojo1

What’s the Idea?What’s the Idea?

Deliberate Practice of Key Skills

Learn from others

HAVE FUN!

Deliberate Practice of Key Skills

Learn from others

HAVE FUN!

Page 6: Guildford Coding Dojo1

Dojo RulesDojo Rules

We respect each other’s commitment (No phones, email, Facebook etc)

We all do TDD

We all do pair programming

We do “Simple Design”

We respect each other’s commitment (No phones, email, Facebook etc)

We all do TDD

We all do pair programming

We do “Simple Design”

Page 7: Guildford Coding Dojo1

Simple DesignSimple Design

All tests pass

Clear, expressive and consistent

Does not duplicate behaviour or configuration

Minimises the number of classes and methods

All tests pass

Clear, expressive and consistent

Does not duplicate behaviour or configuration

Minimises the number of classes and methods

Page 8: Guildford Coding Dojo1

FormatFormat

Pair up

A problem is presented to be solved

We work on it in pomodoros (25 minute cycles) - http://tomato.ist/gcd

When time up, 5 minute break to demo your code to nearby pair, and reflect

At the end we show & tell our code

Pair up

A problem is presented to be solved

We work on it in pomodoros (25 minute cycles) - http://tomato.ist/gcd

When time up, 5 minute break to demo your code to nearby pair, and reflect

At the end we show & tell our code

Page 9: Guildford Coding Dojo1

TDD RefreshTDD Refresh

Write a failing test

Watch it fail(!)

Write code to make it pass

Refactor

Rinse & repeat

Write a failing test

Watch it fail(!)

Write code to make it pass

Refactor

Rinse & repeat

Page 10: Guildford Coding Dojo1

Uncle Bob’s Laws of TDDUncle Bob’s Laws of TDD

You may not write production code until you have written a failing unit test

You may not write more of a unit test than is sufficient to fail (not compiling is a counted as a test failure)

You may not write more production code than is sufficient to pass the currently failing test

You may not write production code until you have written a failing unit test

You may not write more of a unit test than is sufficient to fail (not compiling is a counted as a test failure)

You may not write more production code than is sufficient to pass the currently failing test

Page 11: Guildford Coding Dojo1

FizzBuzzFizzBuzzWrite a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”:

1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, FizzBuzz, 16, 17, etc...

Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”:

1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, FizzBuzz, 16, 17, etc...

Page 12: Guildford Coding Dojo1

http://tomato.ist/gcdhttp://tomato.ist/gcd

Page 13: Guildford Coding Dojo1

http://tomato.ist/gcdhttp://tomato.ist/gcd

Page 14: Guildford Coding Dojo1

FizzBuzz (2)FizzBuzz (2)Now modify your code to print “Whizz” for multiples of 7!

Multiple of 3: Fizz

Multiple of 5: Buzz

Multiple of 7: Whizz

Now modify your code to print “Whizz” for multiples of 7!

Multiple of 3: Fizz

Multiple of 5: Buzz

Multiple of 7: Whizz

Page 15: Guildford Coding Dojo1

http://tomato.ist/gcdhttp://tomato.ist/gcd

Page 16: Guildford Coding Dojo1

http://tomato.ist/gcdhttp://tomato.ist/gcd

Page 17: Guildford Coding Dojo1

FizzBuzz (3)FizzBuzz (3)Now modify your code to print “Fizz” for multiples of 3 AND numbers with digit 3 in them!

Multiple of 3 or contains digit ‘3’: Fizz

Multiple of 5: Buzz

Multiple of 7: Whizz

Now modify your code to print “Fizz” for multiples of 3 AND numbers with digit 3 in them!

Multiple of 3 or contains digit ‘3’: Fizz

Multiple of 5: Buzz

Multiple of 7: Whizz

Page 18: Guildford Coding Dojo1

http://tomato.ist/gcdhttp://tomato.ist/gcd

Page 19: Guildford Coding Dojo1

http://tomato.ist/gcdhttp://tomato.ist/gcd

Page 20: Guildford Coding Dojo1

So how did it go?So how did it go?

Is the code clean?

Any smells?

Refactored? How often?

Open/Closed?

Is the code clean?

Any smells?

Refactored? How often?

Open/Closed?

Page 21: Guildford Coding Dojo1

Thank YouThank You

Chris PittsChris Pitts@thirstybear@thirstybear

This work is licensed under a Creative Commons Attribution-This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.NonCommercial-NoDerivs 3.0 Unported License.

Page 22: Guildford Coding Dojo1

No, really...we’re done!No, really...we’re done!