Coderetreat @Sofia 2012 10 27
-
Upload
adi-bolboaca -
Category
Technology
-
view
111 -
download
0
Transcript of Coderetreat @Sofia 2012 10 27
![Page 2: Coderetreat @Sofia 2012 10 27](https://reader036.fdocuments.in/reader036/viewer/2022081721/554f74a0b4c9058a148b5521/html5/thumbnails/2.jpg)
www.mozaicworks.com
We
Adi BolboacaOrganizational & Technical
Trainer & Coach
Stefan KanevRuby on Rails consultant
![Page 3: Coderetreat @Sofia 2012 10 27](https://reader036.fdocuments.in/reader036/viewer/2022081721/554f74a0b4c9058a148b5521/html5/thumbnails/3.jpg)
Why?
Learn through pairingExtend your comfort zone
PracticeExperiment
Learn new practices
www.mozaicworks.com
![Page 4: Coderetreat @Sofia 2012 10 27](https://reader036.fdocuments.in/reader036/viewer/2022081721/554f74a0b4c9058a148b5521/html5/thumbnails/4.jpg)
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 @Sofia 2012 10 27](https://reader036.fdocuments.in/reader036/viewer/2022081721/554f74a0b4c9058a148b5521/html5/thumbnails/5.jpg)
How it started
CodeMash conference 2009
Gary BernhardtPatrick Welsh
Nayan HajratwalaCorey Haines
www.mozaicworks.com
![Page 6: Coderetreat @Sofia 2012 10 27](https://reader036.fdocuments.in/reader036/viewer/2022081721/554f74a0b4c9058a148b5521/html5/thumbnails/6.jpg)
How it started
RepeatableDay-long
Practice the fundamentals of programmingIntense day of coding
www.mozaicworks.com
![Page 7: Coderetreat @Sofia 2012 10 27](https://reader036.fdocuments.in/reader036/viewer/2022081721/554f74a0b4c9058a148b5521/html5/thumbnails/7.jpg)
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 @Sofia 2012 10 27](https://reader036.fdocuments.in/reader036/viewer/2022081721/554f74a0b4c9058a148b5521/html5/thumbnails/8.jpg)
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 @Sofia 2012 10 27](https://reader036.fdocuments.in/reader036/viewer/2022081721/554f74a0b4c9058a148b5521/html5/thumbnails/9.jpg)
Prerequisites
ComputerCoding environmentTesting framework
Source control (git, svn, etc)
www.mozaicworks.com
![Page 10: Coderetreat @Sofia 2012 10 27](https://reader036.fdocuments.in/reader036/viewer/2022081721/554f74a0b4c9058a148b5521/html5/thumbnails/10.jpg)
The four elements of simple design
1) Passes its tests2) Minimizes duplication
3) Maximizes clarity4) Has fewer elements
www.mozaicworks.com
![Page 11: Coderetreat @Sofia 2012 10 27](https://reader036.fdocuments.in/reader036/viewer/2022081721/554f74a0b4c9058a148b5521/html5/thumbnails/11.jpg)
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 @Sofia 2012 10 27](https://reader036.fdocuments.in/reader036/viewer/2022081721/554f74a0b4c9058a148b5521/html5/thumbnails/12.jpg)
First session
Find a pairChoose a programming language
Setup the environmentChoose an entry point for the problem
Start in 5 min
www.mozaicworks.com
![Page 13: Coderetreat @Sofia 2012 10 27](https://reader036.fdocuments.in/reader036/viewer/2022081721/554f74a0b4c9058a148b5521/html5/thumbnails/13.jpg)
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 @Sofia 2012 10 27](https://reader036.fdocuments.in/reader036/viewer/2022081721/554f74a0b4c9058a148b5521/html5/thumbnails/14.jpg)
Single Responsibility Principle
When the method name has “and” or “or” then split the method
No conditionals: ifs, switch, etcNo try/catch
Exactly one assert per testTest one behaviour per test
www.mozaicworks.com
![Page 15: Coderetreat @Sofia 2012 10 27](https://reader036.fdocuments.in/reader036/viewer/2022081721/554f74a0b4c9058a148b5521/html5/thumbnails/15.jpg)
Pair programming games
Ping-pong pair programmingEvil codingMute pairing
Beginner’s mind
www.mozaicworks.com
![Page 17: Coderetreat @Sofia 2012 10 27](https://reader036.fdocuments.in/reader036/viewer/2022081721/554f74a0b4c9058a148b5521/html5/thumbnails/17.jpg)
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
![Page 18: Coderetreat @Sofia 2012 10 27](https://reader036.fdocuments.in/reader036/viewer/2022081721/554f74a0b4c9058a148b5521/html5/thumbnails/18.jpg)
TDD as if you meant it1) Write exactly one failing test2) Make the test pass by writing implementation code in the test method3) Create a new implementation method by:a) Extracting implementation code to a new method in the test class
b) Moving implementation code into an existing implementation method from the test class
4) Create implementation classes to provide a destination for extracting a method in the test class5) When necessary move implementation methods into implementation classes6) Refactor as required www.mozaicworks.com
![Page 19: Coderetreat @Sofia 2012 10 27](https://reader036.fdocuments.in/reader036/viewer/2022081721/554f74a0b4c9058a148b5521/html5/thumbnails/19.jpg)
Code retreat
Choose your own practice
Decide with your pair in the first 5 minutes
www.mozaicworks.com
![Page 20: Coderetreat @Sofia 2012 10 27](https://reader036.fdocuments.in/reader036/viewer/2022081721/554f74a0b4c9058a148b5521/html5/thumbnails/20.jpg)
Closing circle
1) How did you feel? 2) What did you learn today?
3) What will you do differently tomorrow?
www.mozaicworks.com
![Page 21: Coderetreat @Sofia 2012 10 27](https://reader036.fdocuments.in/reader036/viewer/2022081721/554f74a0b4c9058a148b5521/html5/thumbnails/21.jpg)
Code retreatWhy?
Learn through pairingExtend your comfort zone
PracticeExperiment
Learn new practices
www.mozaicworks.com
![Page 22: Coderetreat @Sofia 2012 10 27](https://reader036.fdocuments.in/reader036/viewer/2022081721/554f74a0b4c9058a148b5521/html5/thumbnails/22.jpg)
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 @Sofia 2012 10 27](https://reader036.fdocuments.in/reader036/viewer/2022081721/554f74a0b4c9058a148b5521/html5/thumbnails/23.jpg)
Code retreatExtend your mentoring & training capacity
Accelerate learning through communities of practice
Grow your functional leaders and top talents
http://www.mozaicworks.com
@adibolb