Coderetreat @Vienna 2013 06 08

23
Code retreat www.mozaicworks.com

description

 

Transcript of Coderetreat @Vienna 2013 06 08

Page 1: Coderetreat @Vienna 2013 06 08

Code retreat

www.mozaicworks.com

Page 2: Coderetreat @Vienna 2013 06 08

www.mozaicworks.com

Me

Adi BolboacaOrganizational & Technical

Trainer & Coach

Page 3: Coderetreat @Vienna 2013 06 08

Why?

Learn through pairingExtend your comfort zone

PracticeExperiment

Learn new practices

www.mozaicworks.com

Page 4: Coderetreat @Vienna 2013 06 08

How?

1 day of codingChoose a simple problem

6 pairing partnersOn average 135 minutes of coding

6 different constraintsA lot of fun!

www.mozaicworks.com

Page 5: Coderetreat @Vienna 2013 06 08

How it started

CodeMash conference 2009

Gary BernhardtPatrick Welsh

Nayan HajratwalaCorey Haines

www.mozaicworks.com

Page 6: Coderetreat @Vienna 2013 06 08

How it started

RepeatableDay-long

Practice the fundamentals of programmingIntense day of coding

www.mozaicworks.com

Page 7: Coderetreat @Vienna 2013 06 08

Day structure

15' introduction3 sessions of 45' coding + 15' retro&break

1h lunch3 sessions of 45' coding + 15' retro&break

15' closing circle

www.mozaicworks.com

Page 8: Coderetreat @Vienna 2013 06 08

Principles

Language agnosticDo not try to finish the problem

Delete the code after each sessionFocus on practicing

Experiment each sessionHave fun!

www.mozaicworks.com

Page 9: Coderetreat @Vienna 2013 06 08

Prerequisites

ComputerCoding environmentTesting framework

Source control (git, svn, etc)

www.mozaicworks.com

Page 10: Coderetreat @Vienna 2013 06 08

The four elements of simple design

1) Passes its tests2) Minimizes duplication

3) Maximizes clarity4) Has fewer elements

www.mozaicworks.com

Page 11: Coderetreat @Vienna 2013 06 08

Conway's game of life

Having an infinite 2D orthogonal universeBeing given an initial generation called a seedThe following rules are applied simultaneously

A live cell having less than 2 live neighbors diesA live cell having 2 or 3 live neighbors lives A live cell having more than 3 neighbors diesA dead cell having 3 neighbors becomes alive

www.mozaicworks.com

Page 12: Coderetreat @Vienna 2013 06 08

First session

Find a pairChoose a programming language

Setup the environmentChoose an entry point for the problem

Start in 5 min

www.mozaicworks.comTwitter:#crVIE13

Page 13: Coderetreat @Vienna 2013 06 08

Conway's game of life

Having an infinite 2D orthogonal universeBeing given an initial generation called a seedThe following rules are applied simultaneously

A live cell having less than 2 live neighbors diesA live cell having 2 or 3 live neighbors lives A live cell having more than 3 neighbors diesA dead cell having 3 neighbors becomes alive

www.mozaicworks.com

Page 14: Coderetreat @Vienna 2013 06 08

Second session

No data structuresUse only one dot/arrow per line

Use domain language

www.mozaicworks.comTwitter:#crVIE13

Page 15: Coderetreat @Vienna 2013 06 08

Focus on refactoring

Use naming that reveals intentRename concepts to improve naming (use

domain language)

Extract duplicate identical chunks of codeExtract methods having the same noun into their

classSplit methods containing Or, And in their names

www.mozaicworks.comTwitter:#crVIE13

Page 16: Coderetreat @Vienna 2013 06 08

Code retreat

1 hour Lunch

www.mozaicworks.comTwitter:#crVIE13

Page 17: Coderetreat @Vienna 2013 06 08

Taking Baby Steps1) Initialize source control repository2) Start a timer for 2 minutes3) Write exactly one testa) Timer rings, the test is red, then revert and go to 2)b) The test is green before the timer rings, then commit

4) Restart timer5) Refactora) Timer rings, the refactoring is not complete then revert and restart

b) The refactoring is complete before the timer rings, commit and go to 2)

Obs.The timers must run continuously, don't stop to talk! www.mozaicworks.com

Twitter:#crVIE13

Page 18: Coderetreat @Vienna 2013 06 08

Focus on Incremental Design

Introduce only one notion at a timeWrite down which notions you introduced

Note down the steps/tests you took

www.mozaicworks.comTwitter:#crVIE13

Page 19: Coderetreat @Vienna 2013 06 08

Pair-Programming Games

Ping-PongEvil Pairing

www.mozaicworks.comTwitter:#crVIE13

Page 20: Coderetreat @Vienna 2013 06 08

Closing circle

1) How did you feel? 2) What did you learn today?

3) What will you do differently tomorrow?

www.mozaicworks.comTwitter:#crVIE13

Page 21: Coderetreat @Vienna 2013 06 08

Code retreatWhy?

Learn through pairingExtend your comfort zone

PracticeExperiment

Learn new practices

www.mozaicworks.comTwitter:#crVIE13

Page 22: Coderetreat @Vienna 2013 06 08

Contact me● Remote pair-programming● Unit testing workshop● Test driven development workshop● Clean code workshop● Refactoring workshop● Legacy code retreat● Legacy code workshop● Code retreat

www.mozaicworks.com

Page 23: Coderetreat @Vienna 2013 06 08

Code retreatExtend your mentoring & training capacity

Accelerate learning through communities of practice

Grow your functional leaders and top talents

http://www.mozaicworks.com

[email protected]

@adibolb