coding dojo: functional calisthenics (2016)

16
Coding Dojo Vienna: Functional Calisthenics Session 20160120 Peter Kofler, ‘Code Cop’ @codecopkofler www.code-cop.org Copyright Peter Kofler, licensed under CC-BY.

Upload: peter-kofler

Post on 14-Apr-2017

509 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Coding Dojo: Functional Calisthenics (2016)

Coding Dojo Vienna:Functional Calisthenics

Session 20160120

Peter Kofler, ‘Code Cop’@codecopkofler

www.code-cop.org

Copyright Peter Kofler, licensed under CC-BY.

Page 2: Coding Dojo: Functional Calisthenics (2016)

Peter Kofler

• Ph.D. (Appl. Math.)

• Professional SoftwareDeveloper for 15 years

• “fanatic about code quality”

• Freelance Code Mentor

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 3: Coding Dojo: Functional Calisthenics (2016)

I help development teams with

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

● Professionalism

● Quality and Productivity

● Continuous Improvement

Page 4: Coding Dojo: Functional Calisthenics (2016)

Mentoring

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

● Pair Programming

● ProgrammingWorkshops

● DeliberatePractice, e.g. Coding Dojos

Page 5: Coding Dojo: Functional Calisthenics (2016)

Developing Quality Software Developers

Page 6: Coding Dojo: Functional Calisthenics (2016)

Coding Dojo Mindset

● Safe place outsidework

● We are here to learn● Need to slow down● Focus on doing it right● Collaborative Game

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 7: Coding Dojo: Functional Calisthenics (2016)

Constraints

● Challenges during a dojo or coderetreat

● Moving to the extreme is a way of learning

● Examples● Missing Tool (No Mouse, …)● Missing Feature (No IFs, …)

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 8: Coding Dojo: Functional Calisthenics (2016)

“Calisthenics” Constraint

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 9: Coding Dojo: Functional Calisthenics (2016)

Functional Calisthenics● Side effects only at the top level (outside domain)● No mutable state● Expressions not statements (and use return value)● Functions should have one argument● No explicit recursion● Maximum type-level abstraction (generic argument types)● Always use/allow infinite sequences● No "if"● Name everything (types for primitives, tuples, lambdas)● Use intermediates (no chaining of function calls)● Don't abbreviate (e.g. full verbs and nouns in names)

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

http://blog.ninjaferret.co.uk/2015/06/05/Introducing-Functional-Calisthenics.html

Page 10: Coding Dojo: Functional Calisthenics (2016)

Assignment

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 11: Coding Dojo: Functional Calisthenics (2016)

Social Network Kata● Implement a social networking application like Twitter.● Use the console for input and output.● Users submit commands to the application.● Commands always start with the user’s name.

● posting: <user name> -> <message>● reading: <user name>● following: <user name> follows <another user>● wall: <user name> wall

● Ignore all user errors and exceptions.● Assume all users will use the same terminal.

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

http://monospacedmonologues.com/post/49250842364/the-social-networking-kata

Page 12: Coding Dojo: Functional Calisthenics (2016)

Prepare

● Find a pair.● Agree on a (functional) prog. language.● Set up the environment.

● Create new project.● Add a testing framework.

● Implement the Social Network.● Obey the rules!

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 13: Coding Dojo: Functional Calisthenics (2016)

Don't Focus on Getting it Done.F0cus on Doing

It Perfectly.

Page 14: Coding Dojo: Functional Calisthenics (2016)

Closing Circle

● What did you learn today?

● What surprised you today?

● What will you do differently in the future?

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 15: Coding Dojo: Functional Calisthenics (2016)

Peter Kofler

@codecopkofler

www.code-cop.org

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 16: Coding Dojo: Functional Calisthenics (2016)

CC Images● Bruce http://www.flickr.com/photos/sherpas428/4350620602/● pairing http://www.flickr.com/photos/dav/94735395/● dojo http://www.flickr.com/photos/49715404@N00/3267627038/● calisthenics https://www.flickr.com/photos/snickclunk/18522120656/● cards https://www.flickr.com/photos/kt/5018975096/● wants you http://www.flickr.com/photos/shutter/105497713/

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY