Thursday, August 20, 2009

Programming - Basic

I earlier said that computers are the defining element of our society. As such, it is a basic requirement to know how to program - if you want to claim to be educated. Without this essential idea you simply are missing out on one of the biggest developments in history and the defining element of "us".

But I did not give any reference for those interested in trying to learn this essential skill.

Here is a basic book (no pun intended), and here is a online basic interpreter to try the examples in the book [-1].

I recommend the book as it really is an introduction [0], and it is written by a famous coder Chris Crawford (so it has contextual interest). As far as I can tell this is the best basic introduction to programming. Your kids can and should read this. You can and should read this. If you cried your way through your science requirements in high school/university, cursing the gods for their cruel ways, you can and should read this. The book is (1) free, (2) short, (3) opinionated [1]. It gets the basic ideas down.

Looking for a general introduction shows there really is not a good option out there for people - could it really be that an old text thrown up on the internet, and used with a free online interpreter, is the best option out there? This seems to be a glaring hole in the literature. Back in the day you could fire up your Apple ][ and run the ubiquitous BASIC before playing a rousing game of Oregon Trail. There is lots of stuff out there, but nothing (modern) that is dirt simple and limited and just there that gets across the basic points [2].

Skimming through this book, You should learn to program by Chris Crawford, was interesting and I sat down and read it more carefully after the initial skim: it is enjoyable (!!), and is surprisingly close to some of my thoughts [3]. The book appears to best fill the niche of actually teaching programming to true beginners [4]. You too should learn to program, and Chris will show you how - and he includes an appendix on how computers work, as well as sociological commentary on the programmer culture.

"
Programming is like writing, woodworking, or photography. Anybody can do it. Doing it well, doing it like an expert – that takes a lot of work, a lot of experience, and a lot of talent. But anybody who can write a comprehensible paragraph can write a workable program. All it takes is a computer and some time." - Chris Crawford, Chapter 1

If you have ever taken a picture, wrote something, or made a simple wood project you know the pleasures that underlie these creations - we are built to act and create - and programming is yet one more form that you should explore to get some joy, learn about a key aspect of our society, and maybe find a new hobby or career [5].

Notes:
[-1] The interpreter linked above doesn't use line numbers, so some changes to the ancient "goto" examples in the book would be needed. This aspect of computers - evolution, versions, and changing infrastructure making things difficult is one of the characteristics of computing. Dealing with hacks is also a key skill - remember the "Y2K" problem? Get used to it, this is a painful yet important idea and learning to confront this is one of the "take home skills" you will get from programming - and these problems exist in all aspects of human tools and society. But to prevent complete initial frustration from being a barrier to entry use this one, I have not yet gone through the entire book with the interpreter but a random selection indicates things generally work (with one caveat: you must include line numbers to inform the interpreter).
[0]
Computer books are "sold by the pound" and are often huge poorly written books. Learning to program can improve your communication, but it will not automagically do this - as a look at most computer books attest to: you have to want it to and work hard at it, but programming does offer a route to better thinking and communication.
[1] Thus interesting. And the author has informed and earned opinions.
[2] There is "SmallBasic" from MS that looks okay, though only for PC's right now - why not on the web? Google has a powerful system, which has a great book for people ready for the next step of working with code that actually does stuff, but I don't see a dead simple system there either. Back in "the day" the Apple ][ was in every class, now a browser is everywhere. What is needed is someone like MS or Google making SmallBasic online - a big player backing a simple tool in order to make it ubiquitous. If you are a Google employee make it so with your 20% time!
[3] Overlap in opinion and ideas is likely a key factor in us deciding on likely quality of a text, and thus worth investing time on. Of course if the overlap is too large you just wasted your time, as you likely don't learn much! If the overlap is too small you likely will discount the text, or you may not be ready for the text. You want some sweet spot of agreeing with some points, and being mystified by some on a first scanning read. People who just read stuff that reiterates and defends their beliefs are called fundamentalists.
[4] If you think about it the vast amount of material in a first year CS class is huge, and one gets a split of the class into (a) those who have been previously exposed to the basics and find the class easy to a bit challenging, and (b) those who are crushed by the course as they have so many new things to learn all while competing against people well ahead of them. People in group (b) should likely read this book as a pre-course exercise to give them context and the basic ideas.
[5] Career? Likely not, but maybe... I am not a carpenter despite loving the one and only project I ever did. But I still have fond memories of my little creation. Even if your dip into programming is just reading Chris' book and playing with an online interpreter while do you do, well you will gain from it. Life is experiential.