Home> Blog> Straw Man for Web Programming

Straw Man for Web Programming

This post originally appeared on the Software Carpentry website.

Last week, I asked what we should teach researchers about the web. I think that I have an answer, and that the easiest way to describe it is by describing what we want learners to be able to build when we're done. So, imagine you are studying changes in rainfall due to climate change in North America. As part of that work, you're comparing results from your simulation with historical data from Environment Canada. Since your calculations may be useful to other scientists, you want to share them on the web. You are therefore going to build a command-line tool so that:

rainy path-to-index.html start-date end-date location

adds a new entry to your online results page by:

  1. reading data from the Environment Canada database,
  2. comparing those historical values to your predictions, and
  3. adding an entry to index.html showing the results.

In order to do this, you will need to understand:

  • how HTTP GET with query parameters works;
  • how to pull things out of XML data (I believe that's what Environment Canada will give us—no sign of JSON on their site); and
  • how to create HTML programmatically.

More fundamentally, they'll see the fetch-remix-publish cycle that underpins so much of the web. Their tool won't be interactive—we won't try to turn it into a CGI script, because doing so would open up too many cans of worms—but I think we can actually do the above in half a day if people are already familiar with something like Python.

Thoughts?