Blog

JSDay 2014: Recap and Highlights

I’m fresh off the plane from JSDay in Italy, where I met a bunch of smart, inspiring people, and learned that JavaScript is even more capable than I thought it was. This coming from a JS fanboy, mind you. Though I learned something from every session I attended, here are some favorites that were particularly enjoyable:

Mark Boas talked about his work with Hyperaudio, which links multimedia with timestamped transcripts. This enables interesting interplay between a video and its underlying text. He demonstrated how easy it to search for a phrase in a transcribed speech, and automatically produce a highlight reel for just that word or phrase. Hypermedia makes media part of the crawl-able, programmatic web. It breaks audio and video out of their black boxes (ahem, looking at you, embed tag), and enables their usage in an algorithmic manner.

Rob Ashton spoke about NPM and Browserify, which is a front-end package manager. The most interesting part of the talk, however, was his discussion of require statements that can quickly get out of hand. If any of your require statements include lots of directory dots and backslashes, you probably have some refactoring to do. Rob makes the argument that “every relative path is a module crying to get out.” Essentially, requiring modules from far away in your application means that that code serves an important purpose beyond its immediate directory. Try abstracting it into a more generalized module, and you may be surprised at its benefits in many applications.

Federico Galassi gave a talk titled “JavaScript and All Its Asynchronous Beasts,” and it’s one I look forward to watching a few times once the video is up. He covered a lot of ground about how to manage the asynchronous nature of JavaScript, something I’m sure all of us struggle with from time to time. Say you have a messy nest of callbacks that looks like this:

function() {
  refuel(function() {
    startEngine(function() {
      takeOff();
    });
  });
};

We don’t want each one to run until its predecessor has finished, so in the past we’ve resorted to stacking callbacks like in the code above. ES6 generators help solve this problem by enabling blocking functions:

function* () {
    yield refuel();
    yield startEngine();
    yield takeOff();
}

In this code, calls to the parent function will stop at each yield statement until told to progress (using the next() statement).

Last but not least, Enrico "Catodo" Zimuel gave a fascinating talk about “Generative Art in JavaScript.” Not only did he open the speech with a badass audiovisual performance piece, but he cited some of the more famous recent examples of software art. (My BA is in art history, and since I now write software for a living, I found this combination of the two fields fascinating and rather beautiful). He introduced timbre.js, a JavaScript library for sound programming. It lets you do awesome things like programmatically generate sounds at specific frequencies, and with varying effects. Check out the documentation for a full list of features.

I was very impressed with the quality of the speakers at JSDay 2014, and am honored to have spoken among them. Thanks to the conference organizers and all the great people I met in Italy. Until next time, ciao!