Saturday, 5 January 2013

JavaScript library recommendations?

I picked up JavaScript a while ago to write a Chrome extension (PawHash) and was surprised to discover that it's not as gross as I thought (though, it still leaves rather a lot to be desired). The negative impression I had previously was mostly based on two things: the DOM API, and the compatibility trickery you have to do in order to use the DOM API in a way that works on all browsers.

So, now I have a couple of projects in mind or in the early stages which are, more or less, clientside JS apps (i.e. singlepage apps that only depend on a server to fetch data, not to render pages). I've picked up AngularJS on a recommendation from a coworker and it's just excellent, removing basically any need to care about the DOM at all, instead just getting magic data binding. It also handles modules and dependency injection, which is nice to write clean code.

I'd like suggestions on what JS libraries I should look into, in order to make it into a richer programming environment. To be clear, I'm not talking about UI/MVC/etc frameworks; I'm talking about things like PrototypeUnderscore or even CoffeeScript (though that's not really a library, but hey). If you have opinions about these libraries, or anything really that isn't a UI tool, then I'd love to hear, but it'd be especially useful if you agree with me about some/all of the following preferences:

  1. I love Python. JS libraries that let me do more Pythony things would be a definite plus.
  2. I love higher order functions and continuation-passing style. Most of the JS code I've written so far makes heavy use of nested closures. Libraries that enable more functional programming idioms are great.
  3. I mostly hate Java. JavaScript's "new" operator and the accompanying constructor weirdness is just bizarre when you already have perfectly good prototypes. Libraries that define lots of pseudo-class constructors look a bit gross to me.
So, yeah. Any suggestions you have, or arguments for/against certain things, I'd love to see: leave me a comment here, or get in touch some other way (you can email me here if you really want), and I'll happily get into a discussion :)