Thoughts on programming for all: Part I — The Merits

I was reading Ira Basen’s article The algorithm method in the Globe and Mail and was reminded of the talk given last week by Professor Mark Guzdial of Georgia Tech as part of the DCS’ Distinguished Lecture Series. Guzdial argued that an introduction to programming, if not computer science, should be an essential part of a liberal arts education due to the way it reshapes the way one views computers, an increasing part of our everyday lives. While I agree with his position that being able to understand the algorithms that dictate whether one is approved for a mortgage or make predictions about climate change search could be useful and important, Basen’s article caused me to question and temper my own beliefs on the importance of introducing programming to undergraduates.

Outside of an intellectually repressive regime that relies on its population’s orthodoxy (arguably any currently existing government), probably few people would disagree that teaching people how to think in new ways (cf. introducing them to ideas) is a bad thing. “Algorithmic thinking”, much like numeracy and logic, can have a huge impact on the way one perceives the world. It can have an impact on almost every facet of one’s life, not just in the world of computers. As Guzdial put it, it’s not about programming, it’s “about process”. In this sense, Ford’s assembly line and Smith’s distribution of labour are examples of algorithmic thinking.  As an aside, I recently suggested an experimental change to the way food was distributed at Hot Yam! because of some observations about the way we serve people; as far as serving is concerned, people coming to eat basically follow one of three code branches (and this is where the optimization lay) in a big while loop:

while yam has food and time < 2:00pm:
        service front of queues.

The expected improvements have been realized, so I think we’re out of beta testing, now, and moving this into the trunk repository of “the way Hot Yam! works”.

In addition to the benefits afforded due to new modes of thinking, learning a programming language (in addition to algorithmic thinking) has more tangible and practical benefits.  Being able to save a few minutes by automating a task here and there can add up.  Also, if one can reduce the chances for human error, this could also prove to be a big plus.  The following is an anecdote I sometimes share with classes I teach and/or TA:

Before being debeakered, one of the dry labs in a class I was taking required each pair of lab partners to count the number of each of the four kinds of DNA nucleobases in set of sequences given as a piece of text on a web page for the lab.  As other groups did, my lab partner began counting the occurrences of adenine manually.  I said I could quickly write a program to do the counting.  My lab partner thought it would be faster and easier to just continue as she was already doing.  I promised to count the thymines and guanines by hand if she could finish the adenines before I was done.  Before she was done counting the adenines in the first sequence of nearly 300 nucleobases, I had managed to start a copy of Python (having begun learning Python about two weeks earlier in CSC207, I wanted some practice) and quickly throw together something along the lines of

sequence = raw_input()
for base in 'ACTG':
    print base + ":" + str(sequence.count(base))

I let her finish counting the first sequence before telling her I was done.  Not only was I much faster, the count produced was reliable; my partner missed a few during her count. We were by far the fastest pair to finish the lab.

Stay tuned for Part II where I discuss some considerations that reduce the appeal of teaching programming to all.

Leave a Reply

Your email address will not be published. Required fields are marked *