Your SlideShare is downloading. ×
Day of code
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Day of code

117
views

Published on

Slides from the all-day workshop "Day of Code" at the London Code Dojo.

Slides from the all-day workshop "Day of Code" at the London Code Dojo.

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
117
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. d e Co of ay ra ftD x for c fo py ee @sl
  • 2. London Code Dojo: Introductions• Put down your croissant (just for the moment)• Say the three things: • Your name • What you do (@work that is) • A random factoid e.g. my mother was a Welsh sheep-farmer @sleepyfox
  • 3. What does it mean? Dojo means:‘Place of learning the Way’ @sleepyfox
  • 4. What does it mean?Kata means ‘way ofdoing’A form or choreographedseries of motionsdesigned to teach aparticular skill or pattern @sleepyfox
  • 5. Kata? @sleepyfox
  • 6. Deliberate Practice• Gladwell1 et. al. 10 yrs or 10,000 hrs practice to achieve expert performance• But practice must: • be focussed • be goal-directed • stretch your abilities • give continuous feedback • be followed by self-reflection @sleepyfox
  • 7. Dojo Kun• We respect each others’ commitment • Please no phones, email, Facebook...• We all do TDD• We all do Pair Programming• We swap partners each cycle• We follow the rules of ‘Simple Design’ @sleepyfox
  • 8. Simple DesignSimple Design is code that:1. Passes all the tests2. Is clear, expressive and consistent3. Duplicates no behaviour or configuration4. Minimises the number of classes and methods and modules @sleepyfox
  • 9. Format• People pair up• We present the problem to be solved• Each cycle is a pomodoro (25 mins) • http://tomatoi.st/codedojo• When time is up: 5 min break to demo your code to nearby team and reflect• Every 2 pomodoros we delete code (but may keep tests), rinse and repeat... @sleepyfox
  • 10. Kata: @sleepyfox
  • 11. Overload• Two players: white and black• White player goes first, play alternates• Pieces are the same colour as player• Must place your piece on either: • An empty square • A square with one of your pieces on • Cannot place on other players piece @sleepyfox
  • 12. Overload 2• If a square is overloaded, pieces explode into adjacent squares• If they land on an opponents piece they are all turned to players colour!• A squares overload limit is: • Corner: 2 • Side: 3 • Middle: 4 @sleepyfox
  • 13. Overload 3• To win: turn all pieces to your colour• (Obviously 1st turn is an exception!)• You have 2 Pomodoros (1 hour) @sleepyfox
  • 14. Begin!Hajime! @sleepyfox
  • 15. Stop!Yame! @sleepyfox
  • 16. 5 minute break• Stop typing!• Now!• 5 mins to show code and reflect• Delete code• (may keep tests) @sleepyfox
  • 17. Object Calisthenics 1• SRP: Single Responsibility Principle• No method more than 5 lines or one indentation level• No method can have more than 2 arguments @sleepyfox
  • 18. Begin!Hajime! @sleepyfox
  • 19. Stop!Yame! @sleepyfox
  • 20. Yame! (stop)• Stop typing!• Now!• 5 mins to show code and reflect• Delete code• (may keep tests) @sleepyfox
  • 21. Lunch @sleepyfox
  • 22. Object Calisthenics 2• To work off some of those calories:• Wrap all Primitives• This includes ints, floats, strings etc. @sleepyfox
  • 23. Begin!Hajime! @sleepyfox
  • 24. Stop!Yame! @sleepyfox
  • 25. Yame! (stop)• Stop typing!• Now!• 5 mins to show code and reflect• Delete code• (may keep tests) @sleepyfox
  • 26. Object Calisthenics 3Law of Demeter:• Each unit should have only limited knowledge about other units: only units "closely" related to the current unit• Each unit should only talk to its friends; dont talk to strangers• Only talk to your immediate friends @sleepyfox
  • 27. Demeter in OO Land• if m is a method of O, m can invoke only: • other methods of O • ms parameters • Any objects created within m • Os direct object components • A global, accessible by O, in scope of m• Only one dot - dog.walk() good, • dog.leg.walk() bad @sleepyfox
  • 28. Begin!Hajime! @sleepyfox
  • 29. Stop!Yame! @sleepyfox
  • 30. Yame! (stop)• Stop typing!• Now!• 5 mins to show code and reflect• Delete code• (may keep tests) @sleepyfox
  • 31. Object Calisthenics 4• First class collections - if a class has a collection in it then it may have no other attributes• All classes must have state - no utilities• No getters, setters, properties: "Tell, dont ask!" @sleepyfox
  • 32. Begin!Hajime! @sleepyfox
  • 33. Stop!Yame! @sleepyfox
  • 34. Yame! (stop)• Stop typing!• Now!• Dont delete code or tests @sleepyfox
  • 35. Reflection @sleepyfox
  • 36. Thank you @sleepyfox on Twitter meetup.com/London-Code-Dojocreativecommons.org/licenses/by-nc-nd/3.0