14 Mar 2010

Analogies for programming

Often, I get asked by nontechnical people what exactly programming is, but it’s a somewhat difficult thing to answer concisely. When I’m thinking about this, most of my comparisons are to: running a team at work that consists entirely of toddlers.

Just like a manager might distribute a memo to his/her team indicating a process to follow in certain situations, a programmer can be considered to be distributing a document that contains a process to follow in certain situations. The manager’s memo might indicate what to do if a link to another office goes down and the team needs communication from them; the programmer’s “memo” might indicate how to modify a photo if the user decides to bump up the contrast setting in Photoshop.

A program, then, is, collectively, a bunch of “memos” that are executed by the computer when the user triggers an action (a mouse click, keyboard press, or any form of input) that the programmer has decided to associate with that memo.

Programmers usually work in units of code files which can be considered documents containing instructions for the computer to execute. It’s up to the programmer to use somewhat primitive instructions to build up documents that provide functionality we take advantage of every day.

The reason I think that the analogy to a manager running his/her team is apt is because a big part of a manager’s job is setting process for his/her team. Similarly, a huge part of computer science is the study of processes: the formal expression of what a process is, the execution of a process efficiently (The word for this which Google has made trendy is “algorithm”), and the analysis of effects of a process.

Next up: the toddler part of this analogy :-)

Comments
blog comments powered by Disqus