Wednesday, 1 April 2015

Understanding Recursion

A good friend once told me: “to understand recursion you have to understand recursion”. Being a music major at the time, I didn’t get the joke, but now it seems depressingly accurate. Up until now,  anything I tried to do using Python was more difficult for the computer than it was for me: I needed complicated sets of for loops and if statements, accounting for every last possibility, to answer questions that I can do myself without even a pen and paper (Where do words begin and end? Is this a sentence? Did I get a passing grade or not?)  Recursion is a different story - I type a few lines of code, the computer zooms through it, and 20 minutes later I’m still trying to figure out how the heck it worked. 

Which isn’t to say it’s not a really interesting and useful concept. Defining something in terms of itself is a surprisingly efficient way to get things done. But it also requires a different way of thinking than anything else I’ve encountered in programming so far. You need to put a lot more trust in your computer, and, to some extent, in yourself. And it’s uncomfortable; it’s a leap of faith. But if you just assume that, at a basic level, you can understand recursion - then you can understand recursion.

Monday, 26 January 2015

Week 3 - Why programmers should also be writers

       Programming, at its heart, is all about communication. People spend years learning how to make sense in programming languages - how to break down complex tasks and ideas in such a way that even a computer, with no reasoning capacity of its own, can understand and work with them. But it’s not all about talking to machines - communicating with other human beings is just as essential in this field. After all, the amazing array of computer programs available to us today could never have been produced by individuals working in isolation - programmers work as teams, and build on each other’s work, and this requires a good command of at least one human language. We don’t think exactly like computers do, and a well-written docstring or a clear explanation of a problem can convey in a few minutes what it might take hours to deduce by reading pure code - even for an experienced programmer. 
If anything, though, it’s even more important to be able to communicate programming concepts to those who don’t have any experience in the field - and this requires even more finely honed writing skills, since you can’t rely on professional jargon to get your point across. Most people in modern society rely heavily on computers and software in their day to day lives, but to many of us (myself included, though I’m hoping to change this over the course of my studies) these things are a complete mystery.  With a strong knowledge of programming and good writing skills, I can provide people with essential information that they would otherwise be cut off from. This, I think, is the ultimate goal of this blog - to keep track of the challenges of programming from a beginner’s, or an outsider’s, perspective, so that someday in the future, when my child or my friend or a random stranger on the internet needs needs help, I know how to give it to them.