Why code in Node.js  often get rejected by SoundCloud
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Why code in Node.js often get rejected by SoundCloud

on

  • 4,299 views

From: http://gotocon.com/aarhus-2013/presentation/Why%20code%20in%20Node.js%20often%20gets%20rejected%20by%20SoundCloud ...

From: http://gotocon.com/aarhus-2013/presentation/Why%20code%20in%20Node.js%20often%20gets%20rejected%20by%20SoundCloud

At SoundCloud we ask candidates to send us some code before inviting them in for interviews. Candidates can use whatever language they want, and over the past years we saw a massive rise on the number of submissions using server-side JavaScript. Unfortunately, too many submissions are asynchronous blobs of procedural code.

JavaScript is a fairly functional language, and over the past decades Functional Programming developed interesting solutions for many of the problems we face when writing Node.js and regular JavaScript. Let's talk about how to leverage good old Functional Programming techniques to make code less coupled and more readable!

Statistics

Views

Total Views
4,299
Views on SlideShare
4,242
Embed Views
57

Actions

Likes
19
Downloads
12
Comments
0

3 Embeds 57

https://twitter.com 55
http://www.conferize.com 1
https://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Why code in Node.js often get rejected by SoundCloud Presentation Transcript

  • 1. Why code in Node.js often get rejected by SoundCloud Phil Calçado - SoundCloud @pcalcado http://philcalcado.com Tuesday, October 1, 13
  • 2. 2011: Phil zieht nach Berlin Tuesday, October 1, 13
  • 3. Tuesday, October 1, 13
  • 4. ~ 200 million users / month > 11 hours of audio uploaded every minute Tuesday, October 1, 13
  • 5. Tuesday, October 1, 13
  • 6. http://bit.ly/15DToNK hiring @ SoundCloud Tuesday, October 1, 13
  • 7. Phone Code Review Interviews Offer Tuesday, October 1, 13
  • 8. Phone Code Review Interviews Offer Tuesday, October 1, 13
  • 9. challenge until late 2012 Tuesday, October 1, 13
  • 10. you can choose any language. 0 10 20 30 40 Ruby Java JavaScript (Node.js) C Clojure Scala % of submissions ~2011-2012 Tuesday, October 1, 13
  • 11. you can choose any language. 0 10 20 30 40 Ruby Java JavaScript (Node.js) C Clojure Scala rejected before interview invited for inverview Tuesday, October 1, 13
  • 12. new challenge Tuesday, October 1, 13
  • 13. you can choose any language. 0 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
  • 14. you can choose any language. 0 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
  • 15. you can choose any language. 0 7.5 15 22.5 30 Ruby Java JavaScript (Node.js) Go Clojure Scala rejected before interview invited for inverview Tuesday, October 1, 13
  • 16. you can choose any language. 0 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
  • 17. http://bit.ly/J1aLNn don’t get me wrong we are all hipsters Tuesday, October 1, 13
  • 18. Tuesday, October 1, 13
  • 19. Not OO, not Functional... Just (bad) Procedural code. Tuesday, October 1, 13
  • 20. http://bit.ly/JiECRp Tuesday, October 1, 13
  • 21. we don’t need this complicated stuff. this is not java, you know. Tuesday, October 1, 13
  • 22. http://bit.ly/JiFSnq so how do we structure our app? Tuesday, October 1, 13
  • 23. what to use? (decent) procedures? Tuesday, October 1, 13
  • 24. Tuesday, October 1, 13
  • 25. Tuesday, October 1, 13
  • 26. what to use? objects? Tuesday, October 1, 13
  • 27. Tuesday, October 1, 13
  • 28. what to use? ...functions? Tuesday, October 1, 13
  • 29. http://bit.ly/JFbZt8 Tuesday, October 1, 13
  • 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
  • 31. http://bit.ly/JiEQYM Tuesday, October 1, 13
  • 32. Tuesday, October 1, 13
  • 33. Tuesday, October 1, 13
  • 34. Tuesday, October 1, 13
  • 35. Tuesday, October 1, 13
  • 36. Tuesday, October 1, 13
  • 37. http://bit.ly/JiF7ef going old school Tuesday, October 1, 13
  • 38. e.g. passing functions around Tuesday, October 1, 13
  • 39. we see a lot of this Tuesday, October 1, 13
  • 40. 1st, we extract what is common Tuesday, October 1, 13
  • 41. then we refactor our functions Tuesday, October 1, 13
  • 42. and we send them as arguments Tuesday, October 1, 13
  • 43. e.g. closures not only for objects Tuesday, October 1, 13
  • 44. we see a lot of this Tuesday, October 1, 13
  • 45. we can keep writeComment as it is Tuesday, October 1, 13
  • 46. and we add a function with two closures Tuesday, October 1, 13
  • 47. and we add a function with two closures immutable Tuesday, October 1, 13
  • 48. and we add a function with two closures immutablemutable Tuesday, October 1, 13
  • 49. now we don’t need to pass in the kitchen sink Tuesday, October 1, 13
  • 50. e.g. functions all the way down Tuesday, October 1, 13
  • 51. we see a lot of this Tuesday, October 1, 13
  • 52. first we extract common protocol Tuesday, October 1, 13
  • 53. then we clean up our functions Tuesday, October 1, 13
  • 54. then we use them. Tuesday, October 1, 13
  • 55. then we use them. redundant? Tuesday, October 1, 13
  • 56. http://bit.ly/JiETnd Tuesday, October 1, 13
  • 57. our “framework”: 1 - Extract protocol in “combinators” 2 - Keep mutable state in closures Tuesday, October 1, 13
  • 58. no scary monads required Tuesday, October 1, 13
  • 59. there is plenty to learn from Tuesday, October 1, 13
  • 60. in the javascript community too Tuesday, October 1, 13
  • 61. phil calçado http://philcalcado.com @pcalcado www.soundcloud.com Tuesday, October 1, 13
  • 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