Why code in Node . js often get rejected by SoundCloud Phil Calado - - - PowerPoint PPT Presentation

why code in node js often get rejected by soundcloud
SMART_READER_LITE
LIVE PREVIEW

Why code in Node . js often get rejected by SoundCloud Phil Calado - - - PowerPoint PPT Presentation

Why code in Node . js often get rejected by SoundCloud Phil Calado - SoundCloud @pcalcado http :// philcalcado . com Tuesday, October 1, 13 2011: Phil zieht nach Berlin Tuesday, October 1, 13 Tuesday, October 1, 13 > 11 hours of audio


slide-1
SLIDE 1

Why code in Node.js

  • ften get rejected by

SoundCloud

Phil Calçado - SoundCloud @pcalcado http://philcalcado.com

Tuesday, October 1, 13

slide-2
SLIDE 2

2011: Phil zieht nach Berlin

Tuesday, October 1, 13

slide-3
SLIDE 3

Tuesday, October 1, 13

slide-4
SLIDE 4

~ 200 million users / month > 11 hours of audio uploaded every minute

Tuesday, October 1, 13

slide-5
SLIDE 5

Tuesday, October 1, 13

slide-6
SLIDE 6

http://bit.ly/15DToNK

hiring @ SoundCloud

Tuesday, October 1, 13

slide-7
SLIDE 7

Phone Code Review Interviews Ofger

Tuesday, October 1, 13

slide-8
SLIDE 8

Phone Code Review Interviews Ofger

Tuesday, October 1, 13

slide-9
SLIDE 9

challenge until late 2012

Tuesday, October 1, 13

slide-10
SLIDE 10

you can choose any language.

10 20 30 40 Ruby Java JavaScript (Node.js) C Clojure Scala

% of submissions ~2011-2012

Tuesday, October 1, 13

slide-11
SLIDE 11

you can choose any language.

10 20 30 40 Ruby Java JavaScript (Node.js) C Clojure Scala

rejected before interview invited for inverview

Tuesday, October 1, 13

slide-12
SLIDE 12

new challenge

Tuesday, October 1, 13

slide-13
SLIDE 13

you can choose any language.

7.5 15 22.5 30 Ruby Java JavaScript (Node.js) Go Clojure Scala

% of submissions on the past ~1 year

Tuesday, October 1, 13

slide-14
SLIDE 14

you can choose any language.

7.5 15 22.5 30 Ruby Java JavaScript (Node.js) Go Clojure Scala

% of submissions on the past ~1 year

Tuesday, October 1, 13

slide-15
SLIDE 15

you can choose any language.

7.5 15 22.5 30 Ruby Java JavaScript (Node.js) Go Clojure Scala

rejected before interview invited for inverview

Tuesday, October 1, 13

slide-16
SLIDE 16

you can choose any language.

7.5 15 22.5 30 Ruby Java JavaScript (Node.js) Go Clojure Scala

rejected before interview invited for inverview

WTF?

Tuesday, October 1, 13

slide-17
SLIDE 17

http://bit.ly/J1aLNn

don’t get me wrong we are all hipsters

Tuesday, October 1, 13

slide-18
SLIDE 18

Tuesday, October 1, 13

slide-19
SLIDE 19

Not OO, not Functional... Just (bad) Procedural code.

Tuesday, October 1, 13

slide-20
SLIDE 20

http://bit.ly/JiECRp

Tuesday, October 1, 13

slide-21
SLIDE 21

we don’t need this complicated stufg. this is not java, you know.

Tuesday, October 1, 13

slide-22
SLIDE 22

http://bit.ly/JiFSnq

so how do we structure our app?

Tuesday, October 1, 13

slide-23
SLIDE 23

what to use?

(decent) procedures?

Tuesday, October 1, 13

slide-24
SLIDE 24

Tuesday, October 1, 13

slide-25
SLIDE 25

Tuesday, October 1, 13

slide-26
SLIDE 26

what to use?

  • bjects?

Tuesday, October 1, 13

slide-27
SLIDE 27

Tuesday, October 1, 13

slide-28
SLIDE 28

what to use?

...functions?

Tuesday, October 1, 13

slide-29
SLIDE 29

http://bit.ly/JFbZt8

Tuesday, October 1, 13

slide-30
SLIDE 30

http://bit.ly/JFbZt8

“SICP and some of the Sussman & Steele "Lambda the ..." papers made a big impression on me years before, although I did not understand their full meaning then. Remember, I was recruited to "do Scheme" [...] My interest in languages such as Self informed a subversive agenda [...]. Likewise with first-class functions, which were inspired by Scheme [...]”

Tuesday, October 1, 13

slide-31
SLIDE 31

http://bit.ly/JiEQYM

Tuesday, October 1, 13

slide-32
SLIDE 32

Tuesday, October 1, 13

slide-33
SLIDE 33

Tuesday, October 1, 13

slide-34
SLIDE 34

Tuesday, October 1, 13

slide-35
SLIDE 35

Tuesday, October 1, 13

slide-36
SLIDE 36

Tuesday, October 1, 13

slide-37
SLIDE 37

http://bit.ly/JiF7ef

going old school

Tuesday, October 1, 13

slide-38
SLIDE 38

e.g. passing functions around

Tuesday, October 1, 13

slide-39
SLIDE 39

we see a lot of this

Tuesday, October 1, 13

slide-40
SLIDE 40

1st, we extract what is common

Tuesday, October 1, 13

slide-41
SLIDE 41

then we refactor our functions

Tuesday, October 1, 13

slide-42
SLIDE 42

and we send them as arguments

Tuesday, October 1, 13

slide-43
SLIDE 43

e.g. closures not only for objects

Tuesday, October 1, 13

slide-44
SLIDE 44

we see a lot of this

Tuesday, October 1, 13

slide-45
SLIDE 45

we can keep writeComment as it is

Tuesday, October 1, 13

slide-46
SLIDE 46

and we add a function with two closures

Tuesday, October 1, 13

slide-47
SLIDE 47

and we add a function with two closures

immutable

Tuesday, October 1, 13

slide-48
SLIDE 48

and we add a function with two closures

immutable mutable

Tuesday, October 1, 13

slide-49
SLIDE 49

now we don’t need to pass in the kitchen sink

Tuesday, October 1, 13

slide-50
SLIDE 50

e.g. functions all the way down

Tuesday, October 1, 13

slide-51
SLIDE 51

we see a lot of this

Tuesday, October 1, 13

slide-52
SLIDE 52

first we extract common protocol

Tuesday, October 1, 13

slide-53
SLIDE 53

then we clean up our functions

Tuesday, October 1, 13

slide-54
SLIDE 54

then we use them.

Tuesday, October 1, 13

slide-55
SLIDE 55

then we use them.

redundant?

Tuesday, October 1, 13

slide-56
SLIDE 56

http://bit.ly/JiETnd

Tuesday, October 1, 13

slide-57
SLIDE 57
  • ur “framework”:

1 - Extract protocol in “combinators” 2 - Keep mutable state in closures

Tuesday, October 1, 13

slide-58
SLIDE 58

no scary monads required

Tuesday, October 1, 13

slide-59
SLIDE 59

there is plenty to learn from

Tuesday, October 1, 13

slide-60
SLIDE 60

in the javascript community too

Tuesday, October 1, 13

slide-61
SLIDE 61

phil calçado http://philcalcado.com @pcalcado

www.soundcloud.com

Tuesday, October 1, 13

slide-62
SLIDE 62

How to Design Programs - http://bit.ly/K0BfrL Structure and Interpretation of Computer Programs - http://bit.ly/K0BjYm The Art of the Metaobject Protocol http://amzn.to/K0BqU1 Purely Functional Data Structures http://amzn.to/JFn4KG Let Over Lambda - http://amzn.to/IMMkNO An Introduction to Lambda Calculi for Computer Scientists - http://amzn.to/IX8d1B All drawings are available as t-shirts from the awesome Diesel Sweeties - http://dieselsweeties.com/

Tuesday, October 1, 13