Today it is easier than ever to learn how to program a computer. Everyone has one (and probably has several) and there are tons of resources available. You can even program entirely in your web browser and avoid having to install programming languages and other arcane software. But it wasn’t always like this. In the sixties and seventies, you usually learned to program on computers that didn’t exist. I was recently musing about those computers that were never real and wondering if we are better off now with a computer at every neophyte’s fingertips or if somehow these fictional computing devices were useful in the education process.
Back in the day, almost no one had a computer. Even if you were in the computer business, the chances that you had a computer that was all yours was almost unheard of. In the old days, computers cost money — a lot of money. They required special power and cooling. They needed a platoon of people to operate them. They took up a lot of space. The idea of letting students just run programs to learn was ludicrous.
Continue reading “Computers That Never Were”
My heyday in programming was about five years ago, and I’ve really let my skills fade. I started finding myself making excuses for my lack of ability. I’d tackle harder ways to work around problems just so I wouldn’t have to code. Worst of all, I’d find myself shelving projects because I no longer enjoyed coding enough to do that portion. So I decided to put in the time and get back up to speed.
Normally, I’d get back into programming out of necessity. I’d go on a coding binge, read a lot of documentation, and cut and paste a lot of code. It works, but I’d end up with a really mixed understanding of what I did to get the working code. This time I wanted to structure my learning so I’d end up with a more, well, structured understanding.
However, there’s a problem. Programming books are universally boring. I own a really big pile of them, and that’s after I gave a bunch away. It’s not really the fault of the writer; it’s an awkward subject to teach. It usually starts off by torturing the reader with a chapter or two of painfully basic concepts with just enough arcana sprinkled in to massage a migraine into existence. Typically they also like to mention that the arcana will be demystified in another chapter. The next step is to make you play typist and transcribe a big block of code with new and interesting bits into an editor and run it. Presumably, the act of typing along leaves the reader with such a burning curiosity that the next seventeen pages of dry monologue about the thirteen lines of code are transformed into riveting prose within the reader’s mind. Maybe a structured understanding just isn’t worth it.
I wanted to find a new way to study programming. One where I could interact with the example code as I typed it. I wanted to end up with a full understanding before I pressed that run button for the first time, not after.
When I first read about literate programming, my very first instinct said: “nope, not doing that.” Donald Knuth, who is no small name in computing, proposes a new way of doing things in his Literate Programming. Rather than writing the code in the order the compiler likes to see it, write the code in the order you’d like to think about it along with a constant narrative about your thoughts while you’re developing it. The method by which he’d like people to achieve this feat is with the extensive use of macros. So, for example, a literate program would start with a section like this:
Continue reading “Learn To Program With Literate Programming”