Alcides Fonseca

40.197958, -8.408312

Casual Programming

One of the nice things about new years is that people blog about their favorite music from the previous year. One of those best of’s was Michal Migurski’s. And he made available all the songs as a mp3 download.

I could have just clicked on the playlist link, but I wanted to download each mp3 and I didn’t want to click on every single link. With my background as a programmer, I feel morally obligated to automate that task. I downloaded the m3u playlist (which is just a text file with a mp3 url per line), opened the Python interpreter and wrote the following 3 lines.

I could have done the same in ruby, scala, perl or simply bash, but the elegance of those lines is simple enough for me. (There’s a curl-based alternative by Sofia, if you don’t have wget)

I expect this kind of automation to be available to everyone out there in a couple of years. Mac OS has tried to do this for a long time, either making applications scriptable with AppleScript, or creating workflows like this example with Automator in a more visual way.

Unfortunately the only people I see using this are Programmers and PowerUsers. The latter tend to just copy snippets and follow tutorials. I don’t believe the current environment allows them to be creative and start from scratch. I really hope this to change some time soon.

I put my faith on projects like Microsoft’s Kodu where they try to make kids program not in a geek computer-language way, but rather in a creative and visual approach. And the interaction is so simple, it can all be done using an xbox controller. I believe this kind of experiences (just like the ones I had playing with Legos for full days) will enable you to start from scratch with just some building blocks, and end up with something useful. I’m not saying this will work with everyone (just like there were people who couldn’t program a VCR, and there are people who cannot install software) but the ones that are curious enough, that will get them a step ahead.