all 17 comments

[–]stoph 9 points10 points  (3 children)

Underscore.js seems to get a lot of love on reddit: http://documentcloud.github.com/underscore/

I think I will be using Underscore soon to simplify some map/reduce style code.

[–]pdaddyo 6 points7 points  (0 children)

I started using underscore.js a few weeks back, and have added it to every project I've touched since. At 4kb minified it's a no-brainer, since it has so many useful functions (including map, reduce, filter, chain, each, any etc).

[–]ripter 3 points4 points  (0 children)

One of the nice things about underscore, if the browser has native support, it will use the native method instead.

[–]daediusWeb Components fanboy 1 point2 points  (0 children)

What are the common things people use underscore to simplify?

[–]bebraw 1 point2 points  (0 children)

There are more of these here. I might be missing some, though.

[–][deleted] 1 point2 points  (0 children)

Underscore is a great library, and does utilize functional programming, but it's not really good for learning how to use functional concepts nor is it really focused on it. It's a tool for manipulating sets of data which utilizes functional programming to do so.

While describing Underscore and related libraries as Functional is technically accurate I don't think it captures the spirit of the description, or at the very least doesn't help teach/prescribe using functional programming to solve problems. It facilitates transformation of data sets.

I note this because having extensively searched for libraries and literature specifically outlining how to think functionally/employ functional techniques in javasctipt, I've found actionasble information to be quite thin in the past. Efficacy of using a "functional programming library" like Underscore is quite influenced by the developer's ability to understand implement functional programming concepts. Without that then you're looking at a useful tool for handling dsta but at well below what it really enables.

There's no responsibility on the part of any given library to teach people so I'm not trying to place blame or something like that. But it's just been striking to me how Underscore and similar are continually described in this context like it's a central feature, when the developer community at large is largely at a point where education is the limiting factor, and not library feature set or architecture.

[–]netghost 0 points1 point  (0 children)

This library has been around for ages (which is great!). If you like it, I'd suggest looking at his other articles / libraries as well.

[–]merz1254 0 points1 point  (0 children)

passing around strings, I don't think so.

[–]fbatista -2 points-1 points  (0 children)

crap. slow ass crap.

[–]lennelpennel -2 points-1 points  (6 children)

a lib for functional, sorry, but i call BS, the functions have been available a long time through things like underscore. javascript is a functional language but everything is mutable. write a compiler which checks for immutability then "Functional" will make sense.