Behavioral product strategist and gamification designer. This is my public hypertext notebook, sharing my thinking in motion at various stages of development.


Direct functions and end-user programming

Just a little anecdote of a small project:

I needed to make a program to resize images in a weird way for GuidedTrack. Instead of scaling images, I needed to add whitespace to the horizontal margins. As far as I could tell, Clojure didn't have many pre-built libraries for it, so I switched to Racket, where it seemed to have some specific functions out of the box to do what I wanted. I figured a Lisp is a Lisp so it couldn't be that different. I was able to make a function in 6 lines of code that would take an images name and dimensions that would transform it.

Here's the first version of it: image-resizer-first-draft

Here's a version that's a bit more automatic (so I wouldn't need to manually enter the dimensions, just the title): image-resizer-second-draft

The crazy thing to me about this is that the first version was fairly plug and play from finding the right items in the documentation. I'm not saying I would have been able to figure it out without any prior knowledge of Lisp from Clojure, but it didn't take much to get me there. That's 6 lines of code to do something where I could have spent a while searching to try and find a pre-made tool. The end function was so easy to use after it was built that I could have easily told someone else how to use it. It felt like I created my own little command line tool.

End-user programming is an incredibly exciting topic for me, and this gives me faith in Domain-specific languages as end-user software. What if we just give people a bunch of prepackaged, composable functions? What if people look at the REPL as an "app" to use these functions?

From Wade Dominic: