Live data from Hacker News

Lodash v3.0.0

lodash.com

31–40 of 82 posts

Re: Lodash v3.0.0

#31
post #9

Earlier quoted context omitted.

I've been looking for some real-world examples of how currying might be useful in javascript. Haven't not used a language which supports currying for any real world project, I'm interested to know how it can help. I found a page [1] which talks about currying in javascript, then says "Are there practical uses for currying in JavaScript? Not really." Can you point me at anything which will help me see why it's useful?…

This slideshow [1] by one of the authors of Ramda.js goes over a JavaScript example in OO style and refactors it to functional style. Currying is used to complete the refactoring. I've linked to the slides on currying but you'll need to back up to follow the whole example. [1] http://scott.sauyet.com/Javascript/Talk/FunctionalProgrammin...

Wow, thanks, that presentation is pure gold! The best thing about FP (and moving into it from the OOP world) I've ever seen: clear, easy to follow, based on a practical example and really presenting the sense behind the use of FP.

Re: Lodash v3.0.0

#32
post #29

We switched from underscore to lodash several months ago, and haven't regretted it. The fact that lodash follows semver is huge. Underscore has introduced serious breaking changes in minor point-releases more than once, which is completely unacceptable for a utility library.

Semver isn't a requirement nor be-all-end-all, though.

It is, however, amazingly convenient and capable of saving a lot of time in bug fixes.

Re: Lodash v3.0.0

#34
Q: "What does it do?"

A: "A utility library delivering consistency, modularity, performance, & extras."

Q: "Yeah, but what does it do?"

A: "Oh, nothing but it does it consistently, modularly and performant. We also have functions for string handling in the extras module."

Re: Lodash v3.0.0

#35
post #23

I followed the link and saw "lodash" for the first time today. Oh, it's a library! With an API! In various formats! I always appreciate it when the top of the project page provides a one-liner explaining just what it is I'm looking at.

Yep, one might think that one could manage a decent description by version 3.0.0

Re: Lodash v3.0.0

#36
post #34

Q: "What does it do?" A: "A utility library delivering consistency, modularity, performance, & extras." Q: "Yeah, but what does it do?" A: "Oh, nothing but it does it consistently, modularly and performant. We also have functions for string handling in the extras module."

It's extra stuff that should be in the standard library but isn't.

These days, a lot of it is actually in the standard library - for example, array maps - and invoking lodash just calls the es5/es6 built in, with a slightly uglier syntax.

Re: Lodash v3.0.0

#37
post #13

Earlier quoted context omitted.

http://stackoverflow.com/questions/13789618/differences-betw...

Thanks - it sounds as if you could use it as a drop in replacement for underscore.

Yes, you can. I've successfully done so in a Backbone/React app.

The _.chain() method furthermore gives a nice functional style ways of building lists which is useful when building UI in React, like so:

    var list = _.chain([1, 2, 3, 4, 5])
        .filter(function (value) {
            return value > 2;
        })
        .map(function (value) {
            return value;
        });

    console.log(list);

    // prints:
    // [3, 4, 5]

Re: Lodash v3.0.0

#38
post #34

Q: "What does it do?" A: "A utility library delivering consistency, modularity, performance, & extras." Q: "Yeah, but what does it do?" A: "Oh, nothing but it does it consistently, modularly and performant. We also have functions for string handling in the extras module."

I also had no idea what this was until I got to the bottom of the page. Looks like a "better underscore.js". They should just say something to that effect upfront.

Re: Lodash v3.0.0

#39
Whoah: "Tested in Chrome 39-40, Firefox 34-35, IE 6-11, Opera 25-26, Safari 5-8"...

IE6+ support! I wonder if that's real, full support, or more like a "there are serious bugs we'll probably never fix for old IE".

Working with old IE versions is loathsome (but still required for some of us), so libraries that just work there are much appreciated.

Re: Lodash v3.0.0

#40
post #34

Q: "What does it do?" A: "A utility library delivering consistency, modularity, performance, & extras." Q: "Yeah, but what does it do?" A: "Oh, nothing but it does it consistently, modularly and performant. We also have functions for string handling in the extras module."

I also had no idea what this was until I got to the bottom of the page. Looks like a "better underscore.js". They should just say something to that effect upfront.

They used too say that when the project was new. Perhaps now they feel the project is established enough that it can stand on it's own without trying to position it as a drop-in replacement for underscore.
Post reply on HN