global day of coderetreat 2013 - prague
TRANSCRIPT
![Page 1: Global Day of Coderetreat 2013 - Prague](https://reader034.vdocuments.site/reader034/viewer/2022042607/55936eb91a28abe95b8b459b/html5/thumbnails/1.jpg)
GDCR PRAHA 2013
![Page 2: Global Day of Coderetreat 2013 - Prague](https://reader034.vdocuments.site/reader034/viewer/2022042607/55936eb91a28abe95b8b459b/html5/thumbnails/2.jpg)
Trénink, trénink, trénink
![Page 3: Global Day of Coderetreat 2013 - Prague](https://reader034.vdocuments.site/reader034/viewer/2022042607/55936eb91a28abe95b8b459b/html5/thumbnails/3.jpg)
For 37 years I’ve practiced fourteen hours a day, and now they call me a genius!
Pablo de Sarasate, Famous Spanish Violinist and Composer
![Page 4: Global Day of Coderetreat 2013 - Prague](https://reader034.vdocuments.site/reader034/viewer/2022042607/55936eb91a28abe95b8b459b/html5/thumbnails/4.jpg)
Conway’s Game of Lifecellular automaton
![Page 5: Global Day of Coderetreat 2013 - Prague](https://reader034.vdocuments.site/reader034/viewer/2022042607/55936eb91a28abe95b8b459b/html5/thumbnails/5.jpg)
• Plocha světa je nekonečná dvourozměrná mříž obsahující buňky.
• Každá z buněk má 8 sousedů.
• Buňka je v jednom že stavu: mrtvá nebo živá.
• Buňky mění stav po každém kroku a všechny v jeden okamžik.
• Stav buňky v dalším kroku je určen stavem její sousedů
Game Of Life
![Page 6: Global Day of Coderetreat 2013 - Prague](https://reader034.vdocuments.site/reader034/viewer/2022042607/55936eb91a28abe95b8b459b/html5/thumbnails/6.jpg)
Pravidla• Pokud má živá buňka míň než dva živé sousedy,
umírá v důsledku nedostaku obyvatel.
• Pokud má živá buňka dva nebo tři živé sousedy, zůstává naživu do dalšího kola.
• Pokud má živá buňka více než tři živé sousedy, umírá v důsledku přemnožení.
• Pokud má mrtvá buňka přesně tři živé sousedy, stává se v dalším kole buňkou živou.
![Page 7: Global Day of Coderetreat 2013 - Prague](https://reader034.vdocuments.site/reader034/viewer/2022042607/55936eb91a28abe95b8b459b/html5/thumbnails/7.jpg)
![Page 8: Global Day of Coderetreat 2013 - Prague](https://reader034.vdocuments.site/reader034/viewer/2022042607/55936eb91a28abe95b8b459b/html5/thumbnails/8.jpg)
4 rules of simple design
• passes all tests
• minimises duplication
• reveals its intent
• has fewer classes/modules/packages…
![Page 9: Global Day of Coderetreat 2013 - Prague](https://reader034.vdocuments.site/reader034/viewer/2022042607/55936eb91a28abe95b8b459b/html5/thumbnails/9.jpg)
Párové programování
• Řidič - řeší implementační detaily
• Navigátor - udržuje nadhled, řeší širší souvislosti
!
• Ping pong
![Page 10: Global Day of Coderetreat 2013 - Prague](https://reader034.vdocuments.site/reader034/viewer/2022042607/55936eb91a28abe95b8b459b/html5/thumbnails/10.jpg)
TDD - Baby steps• Pomocné testy - špruclíky
• Arrange Act Assert
• Assert first
• Fake it till you make it
• Triangulace
• Scalar to Array
• Test behavior not details
![Page 11: Global Day of Coderetreat 2013 - Prague](https://reader034.vdocuments.site/reader034/viewer/2022042607/55936eb91a28abe95b8b459b/html5/thumbnails/11.jpg)
Mute session
PŘÍSNÝ ZÁKAZ MLUVENÍ!'
• komunikace kódem - jsou vaše názvy dost dobré?
• najdi díru v implementaci - zdokumentuj testem
(komentáře nejsou povolené)
![Page 12: Global Day of Coderetreat 2013 - Prague](https://reader034.vdocuments.site/reader034/viewer/2022042607/55936eb91a28abe95b8b459b/html5/thumbnails/12.jpg)
• 4 lines per method
• tell, don’t ask
• no return values
• no conditionals/loops
• no mutability
![Page 13: Global Day of Coderetreat 2013 - Prague](https://reader034.vdocuments.site/reader034/viewer/2022042607/55936eb91a28abe95b8b459b/html5/thumbnails/13.jpg)
Go wild!
• No mouse
• 3D, any-D world
• Configurable set of rules
• TDD as you mean it