In the beginning there were variables and conditionals

Jan-16-2017 13-50-39

I’m teaching a course this semester called Web Intervention where in the first few weeks I’m taking students through an “introduction to programming” for JavaScript on the web so that they can build toward being able to write weird and interesting interactive stuff, eventually availing themselves of the many JavaScript libraries out there for doing cool stuff.

But to start with it’s variables and conditionals.

I really enjoy returning to introductory programming concerns, for reasons I’ve applied in the past to my love and admiration for early videogames: when you have limited technologies (whether that’s the hardware of the Atari or the fact you only know about variables and conditionals) you have to really think about the creative potential of what you do have. You hopefully don’t get caught up in grand visions of high-tech wizardry because you simply cannot achieve it. And, as such, you’re more likely to do interesting work with the basics that really engages with those basics on a deeper level than you often bother with when they become second nature to you.

So it’s been fun trying to think of what simple examples I can provide of using variables and conditionals in conjunction with the web, and what it can make/help us think about. In this case I’ve ended up particularly thinking about time and pacing (not least of all because for the class we’ve also read Michael Connor’s Speaking in Net Language about Olia Lialina’s My Boyfriend Came Back From the War). One of the central qualities of variables (unlike hard-coded values) is that they are capable of change, and one of the clearest ways they might change is to change over time. That simple idea of numbers (or strings of text or whatever) that changes over time introduces so much interesting potential immediately. Throw in a conditional (or event) or two that can check what the user is doing and you can create surprisingly complicated time-based work already.

The above image is of a page that only displays its content if you’re frantically hitting keys on your keyboard, for example. It has this idea of time: the text fades away over time if you don’t do anything. And also this idea of conditionals: you do something if the user is hitting keys on the keyboard. It combines those ideas in a specific way, availing itself of the idea of physical effort applied to a computer for example, to create an overall experience of “effortful web browsing” – which, to me, is weirdly sophisticated for such a basic set of concepts.

So, as above, it’s good to return to simpler concepts. It pushes you to think about how and where you can stretch them, without the pressure of too much diverse and infinite possibility bearing down on you. It’s a good place to work sometimes.

16 January 2017
← next words previous words →