Hey Underscore, You're Doing It Wrong!
Channel:InfoQ · Length:36:30 · Published:2013-05-21 · Views:141472
Summary
Brian Lonsdorf explains why Underscore.js falls short as a functional programming library, then introduces currying, composition and point-free style in JavaScript. He argues for data-last argument ordering.
Why HN recommends it
A repeatedly recommended introduction to functional JavaScript that explains currying and why data should come last.
this video gives a pretty good explanation in ~30 minutes — HN, 2016
Functional programming · Web development
Subtitles (excerpt)
[Music] okay um I'm going to get started because it's the last Talk of the day everybody probably wants to go get a drink I want to go get a drink is there after parties does anybody know all right cool thank somebody grab me and take me to one um so you can yell at me for this talk so um this talk I originally wanted the talk about um lenses and traversible um yeah but it turned out that um you know I've given a couple similar talks and if you've seen um uh me talk at HTML 5 Dev comp before I've spoken about Point free and um type classes and this is kind of a mixture of all that I don't think I could have uh written a talk about anything else because it's people are still trying to get their heads wrapped around this and and I guess I am too and I don't want to go too far without hitting the basics so um pretty much going to talk about uh Point free programming and type classes all in the context of underscore um so yeah and I'm going to bash underscore like crazy you guys not really not so okay so I I do love underscore I think it's great um so I'm not I'm not here to make fun of it or say it's terrible or be like low Dash rules and you know it doesn't work on node and things like that um so uh I am here to talk
On Hacker News
I find this talk inspiring. Underscore.js got many things wrong for FP: [VIDEO] . I've read Grokking Simplicity too. It's very approachable book. Highly recommend it for JS/TS developers who want to learn FP! — r3a1d33p, 2022-08
There is an excellent talk called "Underscore, you're doing it wrong!". The talk explains how well designed param order with currying leads to very short and expressive code -- and how underscore missed the boat. This aspect of it should be interesting as it's related to this post. It's well worth the watch. [VIDEO] — wizao, 2015-01
That is great feedback. I am actually working on creating a "functional" version of the 2048 game, along with my own implementation of the AI solver, as part of this series. Kinda goofy, and maybe not a "real world" situation as much, but should at least show the concepts being applied. I also very much recommend this video by Brian Lonsdorf, titled "Hey Underscore, You're Doing It Wrong!: [VIDEO] — lrichardson, 2014-04
With all due respect, I don't think you understand the purpose of currying and partial application. In your defense, the article merely explains what currying is, but does not explain why you need it. For instance while writing functional Javascript code, I never curry my methods, instead I use helper methods from functional libraries such as lodash or Ramda to curry. Where currying is useful is … — splintercell, 2017-09
Because then you can curry/partially apply functions independent of your data. It's _not_ because it's convention everywhere else. (I realize that only really makes sense if you know why it makes sense, so this video gives a pretty good explanation in ~30 minutes - [VIDEO] ) — patricklynch, 2016-07
Related videos
- AWS re:Invent 2016: Tuesday Night Live with James Hamilton · Amazon Web Services · 1:33:27
- Tracy Young Speaks at Female Founders Conference 2015 · Y Combinator · 26:51
- AWS re:Invent 2018: How AWS Minimizes the Blast Radius of Failures (ARC338) · Amazon Web Services · 55:43
- Zebras All the Way Down - Bryan Cantrill, Uptime 2017 · Code & Supply · 46:36
- Jeff Bezos 1997 Interview · Chuck Severance · 5:39
- Simulating an epidemic · 3Blue1Brown · 23:12
- Paxos lecture (Raft user study) · Diego Ongaro · 1:06:33
- Bret Victor - Inventing on Principle · Rui Oliveira · 54:20
- Advanced Topics in Programming Languages: A Lock-Free Hash Table · GoogleTalksArchive · 58:35
- DNA animation (2002-2014) by Drew Berry and Etsuko Uno wehi.tv #ScienceArt · WEHImovies · 7:19
- Keynote - JSON Graph: Reactive REST at Netflix · Association for Computing Machinery (ACM) · 54:57
- AWS re:Invent 2015 | (NET403) Another Day, Another Billion Packets · Amazon Web Services · 42:25
- A Philosophy of Software Design | John Ousterhout | Talks at Google · Talks at Google · 1:01:40
- Replace Your Exploit-Ridden Firmware with Linux - Ronald Minnich, Google · The Linux Foundation · 38:02
- Functional Composition - Chris Ford · ClojureTV · 39:21
- Refterm Lecture Part 1 - Philosophies of Optimization · Molly Rocket · 18:41
- The Language of the System - Rich Hickey · ClojureTV · 1:02:49
- Om Next - David Nolen · ClojureTV · 46:18
- Antonin Scalia - On American Exceptionalism · AmericanRhetoric.com · 7:21