Yesterday I wrote and published my first open source software, the awfully named jspsi-go-example. It is an experiment module for PsiTurk. PsiTurk makes it easy to run psychology experiments on the web using Amazon Mechanical Turk, where over half a million people do little tasks for a spot of coin. Because I don’t live where my university is, and because my project has a limited budget (as far as payout funding goes for projects with this much programming and set up) I plan on using MTurk this module as the basis of my dissertation experiment. So my little experiment module should come in handy. I even made an icon.

Before yesterday I didn’t really know anything about JavaScript, let alone CoffeeScript, which I find more pleasant and easier to understand than JavaScript because I’ve been programming off and on in Python since the mid 2000s. I also discovered it has a variant for Literate Programming, which I vastly prefer. So I learned that by translating some tutorial code from jsPsych, a JavaScript library that makes it easy to structure experiments and record data on the web. (It’s written by Josh de Leeuw, who is a graduate student at Indiana University Bloomington, my undergraduate alma mater and in the same department!)

Josh’s tutorial has some good starter code. It includes the ability to determine whether or not an answer is correct given some computed criteria, but does not pass that information back to the PsiTurk server or its database. So I wrote that bit.

Then I figured I’d open source it so others wouldn’t have to do the same thing I did. I had only used GitHub as a place to download things from, except when I was writing my masters thesis in LaTeX, where I did use a private repository as a backup system. But I’d never published code. That was very easy to learn, thanks to their great documentation and client-side GUI interface. I didn’t fork Josh’s project, which was probably a faux pas, but oh well; he starred my tweet about this so everything’s okay.

I like CoffeeScript. It makes JavaScript approachable.