26
Phil Calçado - SoundCloud @pcalcado http://philcalcado.com objects can still teach us one or two things. Sunday, January 29, 12

Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

Embed Size (px)

DESCRIPTION

it’s not because you are not in object-land that you can drop minimally good practices

Citation preview

Page 1: Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

Phil Calçado - SoundCloud@pcalcado

http://philcalcado.com

objects can still teach us one or two things.

Sunday, January 29, 12

Page 2: Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

http://bit.ly/work-at-soundcloud

Sunday, January 29, 12

Page 3: Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

(I will not talk about monads, scalaz, bifunctors or burritos)

Sunday, January 29, 12

Page 4: Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

with

Sunday, January 29, 12

Page 5: Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

we thought we would...

Sunday, January 29, 12

Page 6: Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

more like...

Sunday, January 29, 12

Page 7: Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

and then...

Sunday, January 29, 12

Page 8: Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

Sunday, January 29, 12

Page 9: Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

with

Sunday, January 29, 12

Page 10: Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

we think we can...

Sunday, January 29, 12

Page 11: Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

but what I see in the wild...

Sunday, January 29, 12

Page 12: Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

but what I see in the wild...

Sunday, January 29, 12

Page 13: Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

coupling

“cyclomatic complexity”no single responsibility

Sunday, January 29, 12

Page 14: Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

coupling

“cyclomatic complexity”no single responsibility

it’s just (bad) procedural code, really

Sunday, January 29, 12

Page 15: Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

that code was replaced by something like this

Sunday, January 29, 12

Page 16: Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

coupling

“cyclomatic complexity”no single responsibility

Sunday, January 29, 12

Page 17: Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

all old problems.

Sunday, January 29, 12

Page 18: Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

all old problems.

?Sunday, January 29, 12

Page 19: Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

coupling

“cyclomatic complexity”no single responsibility

composition!Sunday, January 29, 12

Page 20: Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

Sunday, January 29, 12

Page 21: Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

higher-order functionscombinators

partial applicationfunction composition

building blocks you need:

Sunday, January 29, 12

Page 22: Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

(I kinda lied)

Sunday, January 29, 12

Page 23: Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

all old problems.

?Sunday, January 29, 12

Page 24: Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

much older than we thought...

Sunday, January 29, 12

Page 25: Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

tl;dr

=> it’s not because you are not in object-land that you can drop minimally good practices=> just using the basic blocks of functional programming gives you a lot=> after a while using these you see patterns emerging. and you understand why monads and friends exist. promise :)

Sunday, January 29, 12

Page 26: Berlin-Brandenburg Scala User Group: objects can still teach us one or two things

Basic Category Theory for Computer Scientists: http://amzn.to/xxeVUC

Theorems for free!: http://bit.ly/Theorems-for-free

The Essence of Functional Programming: http://bit.ly/the-essence-of-FP

Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire: http://bit.ly/FP-with-Bananas-Lenses-Envelopes-and-Barbed-Wire

Sunday, January 29, 12