Skip to content
0:00 / 0:00

#underscore.js#lodash#ramda

Hey Underscore, You're Doing It Wrong!

InfoQ

234K subscribers • 58 videos on Hallway • Conference channel

YouTube
  • Recommended by 12 people: 9 on Hacker News, 1 in engineering communities and 2 curated lists.
  • A classic. People kept recommending it from 2014 to 2022.
  • Presented by Brian Lonsdorf
  • An opinion. It argues one side of a question engineers disagree on.

Intermediate. Assumes working knowledge.

141K views13 years ago12 recommendations

Programming languagesSoftware designJavaScriptFunctional programmingDesign patterns

Brian Lonsdorf explains why Underscore.js fails as a functional library and demonstrates currying, composition, and point-free style in JavaScript.

Brian Lonsdorf has a love-hate relationship with Underscore.js. Yes, it offers a bunch of tools included in today's functional programming paradigm (like map, filter, reduce, take, drop, compose, etc.), but in Underscore the functions are sometimes verbose and unintuitive. It claims to be a functional programming language, but how true is that? Despite certain characteristics, Brian offers some solutions for using Underscore productively. He plays a bit of catchup for the functional programming newbie, but then dives into the denser more theoretical concepts. **Follow along with Brian's slides: mrkn.co/5nvjz

Why it's here

12 people recommend this, 1 disputes it

What people say. Recommended as an inspiring introduction to functional programming concepts, currying, and composition in JavaScript.

lrichardsonon Hacker News • Recommends

On “Functional JavaScript, Part 3: apply, call, and the arguments object”

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!: link to this video

wizaoon Hacker News • Recommends

On “Lodash v3.0.0”

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. link to this video

r3a1d33pon Hacker News • Recommends

On “Ask HN: Learning Functional Programming in 2022?”

I find this talk inspiring. Underscore.js got many things wrong for FP: link to this video . I've read Grokking Simplicity too. It's very approachable book. Highly recommend it for JS/TS developers who want to learn FP!

programming-talkscurated list on GitHubRecommends

Under “Web Development”

Hey Underscore, You're Doing It Wrong! 00:36:31 by **Brian Lonsdorf** (2013)

awesome-talkscurated list on GitHubRecommends

Under “Web Development”

Hey Underscore, You're Doing It Wrong! by **Brian Lonsdorf** (HTML5 Dev Conf 2015) 36:30

grayreston Hacker News • Recommends

On “Don’t Be Scared Of Functional Programming”

If you're interested in FP in javascript, you should check out the relatively new Ramda.js 1. It switches from the underscore style collection first call pattern to a collection last pattern and automatically curries its functions. The combination allows for easier function composition. 1 link More info on the topic: link link to this video link

hueypon Hacker News • Recommends

On “Videos about JavaScript”

I would add: 'Hey Underscore, You're Doing It Wrong' -- link to this video It is much better than the title would suggest :)

lsdafjklsdon Hacker News • Recommends

On “A Gentle Introduction to Monad Transformers – or, Values as Exceptions”

Meh, I don't know or use Haskell and I'm interested in this stuff. I'm a javascript programmer introduced to these concepts via 1 link to this video and link . Programming in a point free style in javascript is great! 1: Hey Underscore, You're Doing it Wrong!

ignoramouson Hacker News • Recommends

On “Mostly Adequate Guide to Functional Programming in JavaScript”

…) can be viewed as Java's abstract-generic-classes with dependency injection 0. Note that functors in different languages mean different things. Monads are tricky to understand 1, I have been led to believe. But if you use the promises API in javascript, then you're using a form of monad 2. If you're familiar with javascript, have a look at: link to this video (Hey Underscore, you're doing it wrong!) I think the best way is to read a book on fn-programming. I've heard most people recommend these (pick a language, and choose a book; you cannot go wrong with any of these): Functional DS: link Real World Haskell: link Real World OCaml: link The Joy of…

patricklynchon Hacker News • Recommends

On “Just: A library of dependency-free JS utilities that do just do one thing”

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 - link to this video )

splintercellon Hacker News • Recommends

On “Currying vs. Partial Application (2015)”

…s(3, users)); //If these methods were curried UserService .getUsers() .then(filterUsers('active', true)) .then(sortUsersBy('age')) .then(takeUsers(3)); ``` Here is a video which explains proper uses of currying (and does it very well) 1. Here is another article if your coworker start using functional programming and you want to stop them 2. 1. link to this video 2. link…

u/fagnerbrackin r/node • Recommends

(2013) Javascript “Underscore” library is not functional programming friendly because of the order of the arguments

ahallockon Hacker News • Disputes

On “How to Become a Great JavaScript Developer”

> Reading and understanding underscore will improve your functional programming skills. No. underscore does it wrong (check link to this video ) Check some of the real functional libs like Ramda and Pointfree Fantasy

seanwoodwardon Hacker News • Mentions

On “Functional JavaScript, Part 3: apply, call, and the arguments object”

@lrichardson, I agree with "your way", and apparently you are not alone. See Brian Lonsdorf talk about it, link to this video

kaonashion Hacker News • Mentions

On “Pun: A small library to enable pattern matching in JavaScript and CoffeeScript”

Recently watched this video, which describes why underscore is actually making this difficult through its design. link to this video

u/EsperSpiritin r/functionalprogramming • Mentions

On “Talking to uni students about FP”

This is one of the talks that got me started with FP. Maybe it gives you some inspiration. Personally I have to say that some concepts are really easy to grasp and some are really hard (also depends on the person). For me monads are just beyond my understanding even though I'm fluent in many programming languages and have studied Clojure and Haskell for many days. Show them something they can use with multi-paradigm languages like JavaScript or Python. It will be easier to understand and also more interesting as it is actually usable for them.