I’m still working on the JavaScript project that I mentioned last week. I think I’ve nearly got promises figured out now. I’ve switched from using jQuery’s promises to using Q. I’m definitely doing enough weird stuff that the jQuery promise support was never going to work for me.

The documentation for Q isn’t bad. There’s a page on moving to Q from jQuery, and that was helpful, as is the API reference page.

This blog post on promise anti-patterns helped me figure out how to handle collections of promises. Q.all() and Q.allSettled() are very useful, once you figure them out. I get the feeling that, while my code works, I’ve probably still got a lot of anti-patterns in there, or at least some fairly sub-optimal constructions.

While working on this stuff, I found that the old Simple Minds song, Promised You A Miracle, started running through my head. I was really hooked on Simple Minds for a while there, back in the early eighties. I hadn’t listened to them or even really thought about them in years, so I’m enjoying a little nostalgia now, via YouTube. (Eighties music videos do look pretty cheesy now, though, huh?) Here’s a new version of the song, an acoustic version with KT Tunstall. It’s not bad.