Previous Entry Share Next Entry
The joy of discovery
I wound up surfing this morning -- I was looking for a specific UI gadget (an AJAX-smart, jQuery UI-based, sortable list window), and decided to just spend some time wandering through jQuery plugins.

I just discovered Underscore.js. Why didn't I already know this existed?

From the look of it, this is one of those packages that most beginner-level Javascript programmers would just scratch their heads at, but many serious programmers would give their right arm for. The concept is very simple: it adds Javascript implementations of all of the standard functional-programming methods that you routinely expect in a serious modern language. It looks magnificently comprehensive; highlights that I am noticing include:

-- _.reduce() provides what I think of as foldLeft (probably the most important utility-belt function for working in collections)
-- A general _.filter() function for collections
-- Array-manipulation functions that treat Arrays like Lists in most languages (head, tail, zip, and that sort of thing)
-- _.partial binds some of the arguments to a function, providing basic currying
-- A general-purpose _memoize() function, which is one of the easiest and safest ways to optimize a lot of problems

And so on. I gather that it is designed to complement jQuery, using _ as the magic character where jQuery uses $.

Anyway, it looks delightful. I expect Querki will pick this up quite soon, and I commend it to any serious programmers who are trying to use Javascript and tearing their hair out over the frustrations of the language. (Yes, you can make life a bit easier with CoffeeScript, but this provides *tons* more tools than that. I suspect you still want it for sophisticated problems, even with CoffeeScript.)

  • 1
Underscore's awesome. And it sounds like you're finding other good stuff, like the search-pill js from last post. Whee!

One way I've found these things is to go to the NPM registry and look for most-downloaded and most-depended-upon packages... Lots of good infrastructure stuff in there, because programmers are drenched in the programming domain.

GitHub's list of most popular forked/starred projects is another place to start. Everyone thinks they're going to make a bootstrap derivative--so it becomes an in-link counter like Google used to use to determine importance. ;)

Edited at 2013-06-13 05:02 pm (UTC)

  • 1

Log in

No account? Create an account