De Omni Scribili

Scribblings Of Ed Wiebe

We Should All Learn to Use a Computer

Say you have a million files in 2900 directories. The directories have different names but the same set of file names occurs in each directory. You want to copy one file out of each directory changing the file names and putting the copies into a new directory. That is, in each of the 2900 directories there are files called A, B, C, and so on, the same names used over and over, once in each directory. You have find and copy 2900 files called B to a new location and change the name so that the 2900 files can all share the new space. How could you do this in a mouse-click, drag-drop environment? It would take all day and your brain would literally die.

However, you can tell the computer how to do this for you. In a (proper) computing system (e.g. Unix) you can use the system (the bash shell in this case) to run a simple program for you.

for file in */filename.png; do
 cp -f "$file" "/home/user/tmp/${file/\/filename}"

This is the kind of simple (to imagine) task that basic exposure to programming empowers you to imagine how to solve. Yes, I had to look up some cryptic syntax things. Learning how to look up and integrate new techniques is also part of learning to program a computer. Looking up a couple of things, writing this out, a quick test, then running it took only a few minutes. The time I saved I spent writing this and having an otherwise much more productive day than I could have had with mouse-click-syndrome. Seriously, writing this up took twice as long as solving the problem.

I am a strong advocate for forcing young brains to learn to think about the problems they want to or have to solve. Exposing them to some set of computer-based tools is important but so is showing them, helping them, encouraging them to think about how to imagine solving a particular problem. That's what I hope will slowly come out of the new initiatives, here in BC and elsewhere, to teach programming computers over using computers to everyone in school from kindergarten to grade 12.

Is this a silly or pathological problem? Yes and no. How do I know what kinds of problems people will want to solve? The point is that solving any problem requires breaking the problem into manageable parts and having familiarity with tools that can be adapted to the task at hand. Decomposition requires practice and familiarity requires exposure.

This page took 0.1 milliseconds to generate.