Wednesday, September 21, 2011

Is making software a craft and/or an art form?

I'm leading a Betascape panel this Saturday called "Art & Code", described as "a panel of smart software creators discussing their careers and to what extent modern making software has become a craft and an art form."

This topic has been much on my mind as I contemplate how we should be training future software makers (vs. future computer scientists and software engineers). Below are the questions I will be posing to the panelists: I'd love to hear your answers in the comments! I'll incorporate anything I learn in this post into the panel, so if you think of other questions I should ask, please tack them on as well.
  • There are many metaphors out there for what we do (crafts person, artisan, engineer, scientist, etc). How do you think of yourself?
    • What aspects of making software feel like an art form to you?
    • What aspects of making software do not feel like an art form to you?
    • When you are designing or writing code, what does it feel like? Is there a performance aspect to your work?
    • What is the most valuable training you received that helps you as a designer or coder today?
    • What is the most valuable training you've experienced on your own? What's been the best self-teaching experience you've had?
    By the way, the Betascape schedule looks really awesome. You should totally plan to come to Baltimore for this, and here's how to buy a ticket!

    Saturday, September 10, 2011

    Using Goliath as an API Proxy

    I recently set up a proxy server using Goliath, a new asynchronous web server from Postrank Labs. I'm building an app that allows users to provision phone numbers from Twilio. To find numbers, I was making calls on the user's behalf to Twilio's AvailablePhoneNumber API. Since our server wasn't doing anything with the data except passing it back to the client, I wondered if it might be easier to setup a web proxy which rewrites the browser's request for data by adding private API credentials to each request, and passes the data through without doing any sort of processing.

    Then I read Gabe Weinberg's post on cool Nginx hacks where he describes this exact technique under the heading "Proxy external JSON calls". Unfortunately this app is hosted on Heroku so my solution is a little more involved than changing an Nginx config. Goliath turned out to be perfect for it, though:

    That code takes requests for Local or TollFree numbers, signs them with my Twilio credentials, and proxies the connection. I have it running on an isolated Heroku app on a separate domain from the rest of my app (since the original app is not running on Goliath) which is why I'm using the JSONP middleware (so the browser can make JSONP requests for this data, avoiding cross-site security restrictions). Twilio gives pretty good error messages in the body of its response which is why I'm returning 200 for all requests. The client can inspect the returned data to see if there were problems with the request.

    By the way the Procfile that run this code on Heroku is simply:

    web: bundle exec ruby lib/twilio.rb -sv -p $PORT -e prod