Coding For Beginners
... or how to program programs with programming
Copyright 2020 by Roger Engelbert
All rights reserved
For information about permission to reproduce selections from this book, write to rengelbert@gmail.com under subject Coding For Beginners Excerpts
Engelbert, Roger.
Coding For Beginners: or How to Program Programs with Programming / Roger Engelbert.1st ed.
p. cm.
ISBN 978-1-912084-27-2
1. Computer science. 2. Computer software. I. Title.
QA75.5-76.95
QA76.75-76.765
Engelbert Publishing.
www.rengelbert.com
Coding For Beginners
... or how to program programs with programming
Roger Engelbert
For Daniel,
who had to learn all this the hard way.
Contents
Feynman's Clerks
{
In 1984, Physicist Richard Feynman presented a series of lectures entitled The Idiosyncratic Thinking Workshop at Esalen Institute in Big Sur, California. The workshop lasted a week and Professor Feynman covered a variety of subjects related to science and the human experience of it. In this workshops second iteration, in 1985, he presented a talk entitled Computers From The Inside Out . This was a concise version of certain lectures he had presented at CalTech in previous years which were later collected in a wonderful book called Feynman Lectures On Computation . They're an introduction to Computer Science, to how computers work and their limitations (at the time).
Lucky for us, we can still find the Esalen lecture on YouTube.
Bill Gates once called Feynman "the best teacher he never had" and you can see why in the video. In the space of 50 minutes Feynman explains what a computer is and what programming a computer means. Along the way he touches on artificial intelligence and how it differs from the human sort. He also mentions machine learning through pattern recognition and heuristics; and touches briefly on the joys of multiprocessor programming (a problem he was actively working to solve at the time). Its mind-boggling stuff. At one point Feynman says computers could not be used to run things like facial recognition algorithms and then pausing briefly he goes on to explain just how exactly one would go about doing it. You realize what he meant was that computers couldn't do it... yet. (And of course, they can now, using the exact process Feynman describes).
But by far, the best part of the lecture is his story involving a series of dumb office clerks. This is also included in the book version of the lectures, therefore we can assume he first presented the analogy in his CalTech lectures. In the story, we hear about filing clerks working for some generic sales company who progressively get dumber and dumber but also faster and faster. We start with a reasonably intelligent clerk who is unfortunately a slow worker. Then the company hires a clerk who is five times faster but who can't add numbers. The next clerk they hire is ten times faster than the previous one but he can't multiply. The next one is again faster but "he doesn't even know that these are numbers!" The story serves to illustrate the point that the computer is an incredibly dumb machine but also incredibly fast. It's up to a human being to feed it the proper, and extremely simple instructions.
Feynman begins the lecture with this pearl: "One of the miseries of life is that everybody names things a little bit wrong, and so it makes everything a little harder to understand in the world as it would be if they were named differently." A computer, he says, does not compute. Or at any rate, this is not its main function. You can make a computer compute, just as you can make a computer draw a picture or brew a pot of coffee. You can tell the computer 2 + 2 = 4, just as you could tell the computer it isn't. A computer is rather a "data handler," Feynman concludes. It manipulates data according to the set of rules you feed the machine. It can read and process or "follow" these rules incredibly fast, and repeat the same instructions ad infinitum with perfect replicability. If the instructions contain an error, this too will be replicated perfectly ad infinitum.
"I like to compare it to a filing system, Feynman begins, and in comes the dumb clerks. Each more helpless than the previous. One cant add, another cant multiply, the next cant read or even know that numbers are numbers. But each clerk is faster than the previous one. The final clerk cant do anything other than hold a simple distinction in his head: A or B, Black or White, 1 or 0. "He's really quite stupid, but man is he fast!" (Feynman uses the colors brown and orange for this in his example because those were the color markers he had available but the video feed cannot pick up the distinction between the two colors: that's technology for ya!)
The solution the company arrives at that enables them to use dumber but faster clerks is to define all the operationsaddition, multiplication, reading alpha numeric characters...as a series of simple procedures involving nothing more than what the dumbest clerk's natural ability to distinguish between 1 and 0 can handle.
Feynman shows how one can perform the procedural equivalent of adding, multiplying and reading and writing by using a simple binary distinction. Why binary? Because it's the simplest change in state: on or off, yes or no. The simplest distinction for the dumbest clerk of all. Even traffic lights may have a more complex state if they contain a yellow light. Yes, computers are dumber than a traffic light. Small electric charges are used to create these changes in state, but Feynman, being Feynman, shows how you could do the same thing using hydraulics. He even illustrates how simple logical operators work inside this hydraulic machine, creating the logical AND and OR operations, also known as Boolean Operations, using logical pipes. Listening to him saying, in his Bugs Bunny accent, "Squirt, squirt, squirt!" is one of the highlights of the lecture, in my opinion.
Most of the operations running your apps, games and media players are built on simple logical operations running on ones and zeros, flowing through logical pipes.
The last clerk in Feynman's analogy is eventually replaced by a machine, the dumbest clerk of all. When all the instructions for this machine are finalized the hypothetical company, we learn, changes to a different sort of business and lo and behold the machine can work for the new type of business as well, by simply changing its instructions. If one can write the instructions for a task in a way the machine can understand and process, the machine will perform the task repeatedly and without variation. Whatever it is. And for an extra bit of history, Alan Turing proposed such a machine in 1936. According to Wikipedia: His universal computing machine would be capable of performing any conceivable mathematical computation if it were representable as an algorithm. But the machine, you see, will always do the same thing, the same operations. It doesnt know its running Candy Crush or Photoshop , and it doesnt do anything fundamentally different when running either of those. The machine is quite dumb! (At least for now. In future, when Im tried for heresy at the first AI Inquisition Symposium, Ill make a pun about being executed and the computers wont get it. Or maybe they'll be so advanced by then, they'll groan and roll their mechanical eyes).
To be fair, and I'm not back-pedaling here, computers are not intelligent in the way we are intelligent and therefore they are not dumb in the same way we are. Feynman uses another brilliant analogy to explain this. If you want to make a machine run as fast as a cheetah, he says, it would be stupid to make the machine run like a cheetah. No, you would use wheels or make the machine glide just above the ground in order to reach the target speed. In the same way that airplanes fly but they don't beat their wings like birds do. The intelligence found in computers is of a different form than the one found in humans (some of them, anyway). We're matching results, not processa very important distinction in programming.