coderetreat - practice to master your crafts

43
Code Retreat Lemi Orhan Ergin Agile Software Craftsman practice to master your crafts

Post on 19-Oct-2014

1.517 views

Category:

Software


3 download

DESCRIPTION

Coderetreat is a one day intense workshop for software developers for imporving their development skills by practicing. This is the material I presented at the beginning of coderetreat I facilitated on May 2014.

TRANSCRIPT

Page 1: Coderetreat - Practice to Master Your Crafts

Code RetreatLemi Orhan Ergin

Agile Software Craftsman

practice to master your crafts

Page 2: Coderetreat - Practice to Master Your Crafts

Agile Software Craftsman Passionate Developer and Coach Sony & GittiGidiyor/eBay

LEMİ ORHAN ERGİN

@lemiorhan

lemiorhanergin.com

@lemiorhan

Page 3: Coderetreat - Practice to Master Your Crafts

like to work alone feel safe to work on confort zone

have to focus on daily work skip writing tests

cannot find time to experiment not willing to learn new practices

do not think about design focus on gettings things done

over-engineer do not refactor

Developers

Page 4: Coderetreat - Practice to Master Your Crafts

have to improve their craft

Developers

Page 5: Coderetreat - Practice to Master Your Crafts

is the best way how we improve our craftPracticing

Page 6: Coderetreat - Practice to Master Your Crafts

How to PracticeChallenge

Repeat Feedback

again and again and again and again

Page 7: Coderetreat - Practice to Master Your Crafts

How to Practice

No Pressuredo not complete the task

but master it

Page 8: Coderetreat - Practice to Master Your Crafts

practicing !

mastering

Code Retreat is about

and

Page 9: Coderetreat - Practice to Master Your Crafts

writing the perfect code

Code Retreat is about

Page 10: Coderetreat - Practice to Master Your Crafts

learning through pairing extending your confort zone

no pressure of daily work experimenting

learning new practices thinking deeply about design

building structures simple developing whenever required

refactoring

Code Retreat is about

Page 11: Coderetreat - Practice to Master Your Crafts

1 day coding 45 minutes sessions

Pair programming Test first development

Different partners on each session Different constraints

Format

Page 12: Coderetreat - Practice to Master Your Crafts

Schedule

Retrospective Break

Closing Ceramony

Coding 45

105 5 5 5 5

10 10 10 10 15

45 45 45 45 45

Lunc

h

Page 13: Coderetreat - Practice to Master Your Crafts

HistoryThe idea was spawned at CodeMash Conference’09 !The owners of the idea Gary Bernhardt Patrick Welsh Nayan Hajratwala Corey Haines !First was held on January 24, 2009

Corey Haineshttps://www.flickr.com/photos/charliekilo/7717370426

Page 14: Coderetreat - Practice to Master Your Crafts

Global Day of Code Retreat

2000+ developers 150+ locations 20 timezones 16 hours of coding 6 continents

coderetreat.orgCoderetreat Community Network

14th of December

https://www.flickr.com/photos/stef3d/4560661663

Page 15: Coderetreat - Practice to Master Your Crafts

Code generation is not important Generate code by thinking the design

Focus on naming test cases Focus on Red/Green/Refactor cycle

Why Repeating?

Page 16: Coderetreat - Practice to Master Your Crafts

You are not your code Learn to go slower

Focus on being better Do not think about finishing

It’s all about practicing

Why Deleting?

Page 17: Coderetreat - Practice to Master Your Crafts

Language agnostic Do not try to complete

Focus on practicing Write code than open to accept change

Follow 4 rules of simple design Delete code after each session

Have fun

Principles

Page 18: Coderetreat - Practice to Master Your Crafts

SOLID Principles Law of Demeter Design Patterns

4 Rules of Simple Design

Design Guidelines

Page 19: Coderetreat - Practice to Master Your Crafts

Simple DesignSimple design in one that is easy to change.We don’t know exactly what is going to need to change We’ll never be more ignorant than we are at this moment

Page 20: Coderetreat - Practice to Master Your Crafts

Simple DesignTests pass

4 Rules of

“Tests pass” can be a significant factor in making changes. If you have to ask how fast your test suite should be, it should be faster

1

Page 21: Coderetreat - Practice to Master Your Crafts

Simple DesignExpress Intent

4 Rules of

Paying attention to the names and how your code expresses itself is the key.

2

Page 22: Coderetreat - Practice to Master Your Crafts

Simple DesignNo Duplication (DRY)

4 Rules of

It’s not about code duplication, it’s about knowledge duplication. Don’t repeat yourself. Every piece of knowledge should have one and only one representation.

3

Page 23: Coderetreat - Practice to Master Your Crafts

Simple DesignSmall

4 Rules of

Has fewer classes, modules, packages. Any not-used code should be deleted. You should also check missing or duplicate abstractions. Over-extraction should also be not allowed.

4

Page 24: Coderetreat - Practice to Master Your Crafts

http://blog.thecodewhisperer.com/2013/12/07/putting-an-age-old-battle-to-rest“Putting an Age-Old Battle to Rest” by Joe Rainsberger

The Simple Design Dynamo

Page 25: Coderetreat - Practice to Master Your Crafts

TDDWrite exactly one new test1

2 Run the test to make sure it fails

3 Write least amount of code to make the test pass

4 Refactor to remove duplication

5 Repeat the process

Test Driven Development Test Driven Design Test First Development

Page 26: Coderetreat - Practice to Master Your Crafts

Zero-player game Cellular automation system

Devised by John Horton Conway Evolution is determined by initial state

Each cell can be alive or dead

Conway’s Game of LifeProblem to solve:

Page 27: Coderetreat - Practice to Master Your Crafts

Each cell has 8 neighbours and follows 3 rules

1 2 3

4

567

8

Page 28: Coderetreat - Practice to Master Your Crafts

Any live cell with fewer than 2 live neighbours dies of loneliness

Rule 1

Page 29: Coderetreat - Practice to Master Your Crafts

Any live cell with more than 3 live neighbours dies of overcrowding

Rule 2

Page 30: Coderetreat - Practice to Master Your Crafts

Any dead cell with exactly 3 live neighbours comes to life of warmth

Rule 3

Page 31: Coderetreat - Practice to Master Your Crafts

Avoid to use primitives Avoid to use conditional conditions (if, ?:, switch) Avoid to use loops (while, for) All methods return void Max 5 lines of code per method Verbs instead of nouns Ping pong programming Mute ping pong programming Swap computers Do not use mouse

Variations

Page 32: Coderetreat - Practice to Master Your Crafts

ENJOYremember whatever you do do not forget to

https://www.flickr.com/photos/fraserspeirs/3394902061Joe O'Brien and Jim Weirich while doing ruby code review

Page 33: Coderetreat - Practice to Master Your Crafts

sessionslet the

beginWe select 6 activities amoung the activities list after checking

TDD and pair programming experiences of the attendees. Every coderetreat has its own set of activities.

Page 34: Coderetreat - Practice to Master Your Crafts

No constraints Do your best

session 1

Page 35: Coderetreat - Practice to Master Your Crafts

Ping-pong pair programming

session 2

Page 36: Coderetreat - Practice to Master Your Crafts

No primitives Use only immutable objects

session 3

Page 37: Coderetreat - Practice to Master Your Crafts

No primitives No conditionals

Max 5 lines of code

session 4

Page 38: Coderetreat - Practice to Master Your Crafts

No way to return any value Verbs instead of Nouns

session 5

Page 39: Coderetreat - Practice to Master Your Crafts

Mute ping-pong

session 6

Page 40: Coderetreat - Practice to Master Your Crafts

What, if anything, did you learn today? What, if anything, surprised you today?

What, if anything, will you do differently?

closing

Page 41: Coderetreat - Practice to Master Your Crafts

https://leanpub.com/4rulesofsimpledesign

The only thing we truly know about software development is that we can expect changes to our system. Through concrete examples, let's explore ways to build flexible, adaptable software systems by better understanding Kent Beck's 4 Rules of Simple Design.

Book from Corey HainesPublished at LeanPub on 2014

Page 42: Coderetreat - Practice to Master Your Crafts

thanks

http://www.coderetreat.orgCoderetreat Community Network

http://blog.zilverline.com/2013/12/20/facilitating-the-global-day-of-coderetreat-2013-in-amsterdamFacilitating the Global Day of Coderetreat 2013 in Amsterdam

http://www.alexbolboaca.ro/wordpress/articles/how-to-organize-a-code-retreatHow to organize a code retreat

Coderetreat Facilitator Traininghttps://vimeo.com/54519386

https://leanpub.com/4rulesofsimpledesignUnderstanding the 4 Rules of Simple Design

Page 43: Coderetreat - Practice to Master Your Crafts

Lemİ orhan ergİn

Founder & Author @ [email protected]

@lemiorhanhttps://www.linkedin.com/in/lemiorhan

@lemiorhanhttps://twitter.com/lemiorhan

@lemiorhanhttps://github.com/lemiorhan

@lemiorhanhttp://www.slideshare.net/lemiorhan

agile software craftsmanagilistanbul.comTurkish blog about agile development

lemiorhanergin.comOfficial site having personal information