The Nintendo stork

In January, the online magazine spiked asked me to write 200 words or less on the question, “What is the greatest innovation in your field?” I thought it was a dumb question, but I answered it anyway. The magazine still hasn’t put up the responses — I guess not enough “thinkers” got back to them yet — but today, since I feel like blogging and don’t have anything else to post, here is my response. Enjoy.

The greatest innovation in computer science was to represent machines — objects that do things, respond to their environments, surprise their creators — as nothing but strings of information. When I was a kid, my overriding ambition was to write my own Nintendo games. But while I could draw the characters and the levels, I had no idea what it would be like to breathe life into a game — to teach the game how to respond to the controller. I pictured thousands of engineers in white lab coats crafting a game cartridge using enormous factory equipment, as they would a 747.

Then a friend showed me a rudimentary spaceship game written in AppleBASIC. Look: here were the lines of code, and here was the game. Slowly it dawned on me that these screenfuls of funny-looking commands weren’t just some sort of blueprint for the game — they were the game. Change the code, and the game would do something different. Better yet, the task of writing the commands was ultimately just a big math problem. This was Alan Turing’s great insight of 1936. For me, it was a revelation comparable only to finding out where babies came from.

(Unfortunately, I’ve long since lost touch with the AppleBASIC-game-playing friend — last I heard through mutual acquaintances, he went off to fight in Afghanistan, and came back injured by a shrapnel bomb.)

48 Responses to “The Nintendo stork”

1. Ran Halprin Says:

Excellent post…

I personally don’t trust programmers or computer scientists who don’t attribute their entrance into the field to the burning desire to create their own games… 🙂

2. Geordie Says:

Thousands of engineers in white lab coats did create the hardware that AppleBASIC code ran on.

3. Osias Says:

But not the games themselves, Gerodie, that’s the point!

4. Blake Stacey Says:

But. . . but. . . I thought BASIC was “considered harmful”! How does a clever, talented, handsome, etc. physics and computer science expert handle the shame of BASIC in their past?

5. Scott Says:

I hope you’re sitting down for this, Blake, but clever, talented, and handsome as your humble blogger might be, he still prefers QBASIC for doing quick calculations.

Just as I have zero ability to learn human languages other than English (as both my Hebrew and Mandarin teachers will attest), so too am I abysmally bad at learning new programming languages. Sure I can do C/C++ when I have to (e.g., when I need more than 64K of memory), but I think in QBASIC, the first language I learned. Maybe I just have the Church-Turing Thesis in my bones?

So let the hotshot coders laugh at me. Let them jeer. But how many of them could make it through a PhD in CS at Berkeley without really learning any OS besides Windows, any text editor besides Notepad, or any programming language besides QBASIC?

6. mick Says:

Sweet mother of God. Scott, that’s a horrific revelation. YOU STILL THINK IN QBASIC! I literally just fell out of my chair.

The last time I used BASIC was in an experimental physics class where we were forced to use ancient PCs to do data analysis. I think it was meant to be like some sort of weird survival course for physicists. You know the type, just in case we ever got stuck on a desert island which only had 286 processors we could still do our analysis….

7. Scott Says:

Oh, come on. QBASIC was an enormous advance over GW-BASIC — it doesn’t even require line numbers!

8. mick Says:

Scott, seriously dude. Go find yourself an undergrad to teach you some of the fancy new-fangled languages out there (says me who has written two simple MATLAB codes in the last 3 years).

9. Walt Says:

Don’t take any lips from the young-uns. The first programming language I ever used for programs of any complexity was Pascal. I haven’t used Pascal in years, but every once in a while I’ll type “:=” instead of “=” in my C programs.

10. mick Says:

Young-uns – I’m like 3 years older than Scott.

11. Blake Stacey Says:

A few months back, SF writer David Brin had a piece in Salon called “Why Johnny Can’t Code” (14 September 2006), whose main thesis was something like the following:

In the olden days, every personal computer came with a programming language which kids could readily sink their claws into. Somehow, despite the saturation of daily life with computers and the profusion of novel programming languages, we lost the easy avenue into programming. For all its clunkiness, BASIC still had a low barrier to entry: its syntax and operation were simple, it was omnipresent, and it was often available by simply turning a computer on. (Contrast this with our modern situation: Python might be better on linguistic grounds, and it might be more suitable for “serious work”, but if you’re a kid in a Windows household, you can’t get it without finding and downloading files. And you damn sure don’t see Python scripts in math and science textbooks.)

When I put the argument that way, most everybody says, “Yeah. Huh. Maybe we could do better about that.” Or, “I work for Apple/MIT Media Lab/Google now, but I started with BASIC when I was a kid. ‘Tain’t like no original sin.”

Which might be why I found the Slashdot crowd’s response to Brin’s essay a little, um, odd. Most of it boiled down to the lament, “David Brin, that nostalgic old fool, loves BASIC,” maybe with an undercurrent of “we’ve been betrayed by an SF writer.” There was also a considerable amount of screaming, “Python! Java! Ruby! KPL!” with nobody actually providing data about whether the proportion of young’uns entering programming (normalized by total number of computer owners) has risen since the BASIC days. Offhand, I don’t know those numbers either; what do I type into Google to get them?

The essay did provoke somebody to make Quite BASIC, which you might appreciate. It’s even got the Henon Strange Attractor!

12. Ran Halprin Says:

I grew up on GW-Basic and later QBasic and Quick Basic (literally grew up – ages 10-17, for the most of them several hours daily) – yet I believe I was not, as Dijkstra put it, “mentally mutilated”… I passed via Pascal and C, but today I think in Java (although I usually still use Matlab).

I still didn’t write any games in any other language but Basic…

13. John Sidles Says:

You young ‘uns know nothing! Fresh off the farm, I learned to code by pushing binary buttons to set the bits of an instruction register, then flipping a lever to execute the instruction! Flipping another lever would output the memory onto a punched tape!

Yessir … 2K of 12 bit words — it was a Control Data 8000 series, housed in a chassis bigger than double-wide home refrigerator.

My job was to write the data-collection programs for this humming beast. Also, whenever the computer broke — which was often — to diagnose which logical gate was broken — there were two gates per circuit card — and solder in a new transistor.

Oh, the glorious feeling of satisfaction! They paid me $300 a month, and beers were a dime on Thursday afternoons. Life was good. Just to mention, that machine was light-years ahead of today’s quantum computers. 🙂 14. Scott Says: Yeah, I learned some Pascal for the AP test, assembly for architecture class, MATLAB for scientific computing class, Java because it seemed cool at the time, and Lisp because I was fired up by Paul Graham’s essays. I’ve since completely forgotten all of them. 15. Scott Says: The essay did provoke somebody to make Quite BASIC, which you might appreciate. That’s terrific — I hadn’t seen that! Except I don’t think it should require line numbers. 16. Koray Says: Scott, Haskell has some following among the pure math types. You may find sigfpe’s posts interesting (esp. this one about quantum computing and monads). 17. Greg Kuperberg Says: I have first-hand experience with this. Python is not only perfectly adequate as a programming language for children, it does come automatically with both Linux and MacOS. Unfortunately, it might not be there in Windows, and in any case the great programming subculture of the old days may have been washed out. Or maybe not? Maybe there are actually more children programming now than before, but their subculture is spread out within a much larger society of non-programming users. 18. Carl Says: I agree that Python is an excellent language for teaching programming to beginners, but I’d like to point out there’s a very common language (or perhaps “language”) which I think is introducing a lot of kids today to programming: HTML. Think about it, basically every kid today has a MySpace or Live Journal or some such. So, they all want to write blog posts and leave each other comments. And if you want what you write to look nice you learn how to use the <b> tag and the <i> tag and so on. Then you decide you don’t just want to do a little post inside a bigger template, you want to do your own template. So, you learn CSS and about how HTML is really supposed to be used. Next you start using a CMS, but you want to tweak a little part of it, so you look at the PHP behind it and change a little. Before too long, you’ve gotten sucked into writing web apps. Crappy PHP ones at first, and eventually ones that use more respectable programming languages. Yeah, I don’t see programming dying out just because BASIC is dead. If anything more kids today are in a position to work their way up the chain from super high level markup (HTML) to custom middleware (managing a CMS) to using a scripting language (PHP) all the way on until they’re doing assembly or whatever. Remember that while we all used BASIC as kids, we were also usually one of the only kids in our classroom who did. Since nowadays everyone has a need for a basic understanding of HTML whereas learning BASIC wasn’t really a necessary part of our social environment, more people will be in a position to enter CS in the years to come. 19. zevans Says: I still feel most comfortable programming with the language I ‘grew up with’ as well. But in my case it happened to be C. I suspect that it is common for people to develop a strong bias toward the first programming language that they learnt. But in my case, I just use C because it’s the most clean, powerful, well standardised, and flexible language ever made. :p 20. Nagesh Adluru Says: Hey Scott, Just some curious questions. Hope you don’t mind. Do you make money with your popularity in blogging? Do you intend to make? Did you get any such offers? I was told people make money by blogging. I was bold enough to ask this because of your nice open nature:) 21. Scott Says: Do you make money with your popularity in blogging? No, not unless this blog leads to higher-paying tenure-tracks (which seems exceedingly doubtful). Do you intend to make? No. I guess I could make a few bucks from ads, but it never seemed worth it. Did you get any such offers? Yes. My parent corporation, Shtetl-Optimized Ventures International (NASDAQ: SHTLOPT), did entertain several$multibillion buyout offers — one from a consortium of Japanese investors, one from BQP Holdings Ltd., one from the same VC’s who invested in D-Wave. In the end, though, I decided to keep controlling stake in the family.

22. tgm Says:

Scott, your last answer is really funny (or is it that I am just tired). But what shocked me reading the post and comments, is that the only text editor you ever used (at least until completing your phd) is notepad. Is that really true? Neither emacs nor vi? I cannot believe it…

23. Scott Says:

I tried emacs and vi and couldn’t stand them. No doubt if I studied them for several decades I’d think differently (“oh, of course — it’s just Ctrl-Shift-Alt-F10 to delete!”).  These days I use WinEdt for text editing. I’ve always written my papers in Scientific Workplace.

24. Ryan Budney Says:

The first language I used was some reverse-polish native language to my dad’s HP calculator… that was back around 1979-1980. I typed in games from the calculator instructions.

My first real language was Basic, on a 4.77MHz PC XT, with something like 64kb of RAM and a math co-processor. My dad had the hot-rod of the neighbourhood. A friend would come over and write games, and I learned by reverse-engineering his code.

I moved to Pascal, wrote a few games myself, then started the migration to C++. But my Microsoft C++ compiler didn’t implement templates correctly and my learning was stunted until grad school, years later. I remember taking my old code that I could never get to compile as a high-school kid on my Microsoft compiler, and it compiled without error in GNU C++ without modification.

I entered mathematics with a desire to write a general-relativity compliant Space-War style multiplayer game. But after learning GR, I realized the time lag stuff would be problematic to implement.

Scott, did you take Hubbard’s multivariable calculus course as an undergrad, and if so, do you remember who your TA was?

26. Scott Says:

Scott, did you take Hubbard’s multivariable calculus course as an undergrad

No, I didn’t. I’d already taken multivar at Clarkson University when I started at Cornell.

27. anonymous Says:

Scott, why not use TeXmacs? Yes, it doesn’t support LaTeX style files, but maybe you could convince some conferences/journals to provide TeXmacs style files.

28. Scott Says:

Scott, why not use TeXmacs?

29. anonymous Says:

To see what TeXmacs typesetting looks like, see the pdf here:

http://www.texmacs.org/Samples/Galois

The main novelty with TeXmacs is that you get this high quality typesetting while editing as well.

http://www.texmacs.org/Samples/texmacs.pdf

30. Scott Says:

I’m just messing around with TeXmacs now. I can see already that I won’t be able to use it exclusively — besides the lack of support for style files, there are all sorts of LaTeX commands that don’t show up right and things I find annoying about the interface. But it should be great as an additional tool, on those occasions where either Scientific Workplace isn’t doing something right or I don’t have access to it. Thanks!!

31. anonymous Says:

Yes, the lack of support for TeX/LaTeX style files is a problem, but if enough people asked, conferences and journals may start supplying TeXmacs style files.

Another possibility it to add a feature to TeXmacs that would take some sample papers from the conference/journal (say in pdf format) and automatically generate a TeXmacs style file for that conference/journal. Yes, it’s only heuristic, but it might be good enough.

32. anonymous Says:

BTW, is scientific workplace truly wysiwyg like texmacs? Does the output look exactly like what you edit?

33. Scott Says:

No, it doesn’t even try to be wysiwyg — I’d describe it as wysic (what you see is comprehensible), as opposed to straight TeX, which is wysisopcipbyc (what you see is something other people can immediately parse but you can’t).

34. anonymous Says:

Well that’s why TeXmacs is an amazing technical achievement. It’s like TeX but with a real-time typesetter. Why are people still using TeX/LaTeX?

35. alfalfa Says:

Do you make money with your popularity in blogging?

No, not unless this blog leads to higher-paying tenure-tracks (which seems exceedingly doubtful).

It is not so unreasonable that your blog (which has most likely led to increased name recognition in the TCS community at large) will lead to 1 or 2 offers that you wouldn’t otherwise have gotten. And this, of course, leads to a better bargaining position, which leads to a better starting salary.

Look at it this way: Via the publicity of your blog, whatever school you join instantly becomes known as a quantum center. Schools like recognition.

Mick said:

The last time I used BASIC was in an experimental physics class where we were forced to use ancient PCs to do data analysis. I think it was meant to be like some sort of weird survival course for physicists. You know the type, just in case we ever got stuck on a desert island which only had 286 processors we could still do our analysis….

I think I can safely hazard a guess that this was at MIT. That school has a very peculiar and specific culture.

37. Greg Kuperberg Says:

I agree that Python is an excellent language for teaching programming to beginners, but I’d like to point out there’s a very common language (or perhaps “language”) which I think is introducing a lot of kids today to programming: HTML.

HTML has everything going for it other than, unfortunately, Turing completeness. Turing completeness is “home plate” in this discussion. Many introductions to computers cop out at second or third base.

I understand that Javascript and PHP are Turing-complete extensions to HTML. That is why they are used. I do not like the way that they blur the distinction between Turing completeness and markup. Combining them with HTML also mixes oil and water, to an extent.

I like Python.

38. Carl Says:

Obviously, HTML isn’t a “programming language” per se, but I stand by the claim that by introducing kids to the idea that “you can control what computers do by changing some psuedo-English text” it sets them at the head of the path to CS enlightenment.

39. mick Says:

Elad, sorry to dissapoint. It was at the University of Queensland, which isn’t quite up to MIT’s standard in, well, anything. We did have some well-known experimental physics profs with an evil sense of humour. I’m sure at least one of them is reading this comment as well…

40. Ryan Budney Says:

Remember the old PC game “Omega”?

http://en.wikipedia.org/wiki/Omega_(1989_computer_game)

That was a pretty addicitive game. The script that you program in was a lot like Basic, too.

41. astephens Says:

Negative, though after poking around on Wikipedia I found this. Fascinating.

42. chris Says:

BBC BASIC II is the business. If I have to write pseudocode in papers I like to number the lines 10,20,30,… Unfortunately co-authors always edit these out.

43. Blake Stacey, OM Says:

Carl said:

Obviously, HTML isn’t a “programming language” per se, but I stand by the claim that by introducing kids to the idea that “you can control what computers do by changing some psuedo-English text” it sets them at the head of the path to CS enlightenment.

Granted. However, I think many of the people around here are interested in using computers to teach sciencey things. We want those up-and-coming whippersnappers to explore what equations mean, how to put together a simulation and so forth. (Poke through the Quite BASIC examples to see what I’m getting at; compare also MIT’s StarLogo. Imagine letting middle- or high-school kids see molecules in motion, bouncing inside a cylinder, holding up the weight of a piston. So much more engaging than being handed the Ideal Gas Law on a dusty platter!) HTML might be an easy path to start upon, but considering the destination we care about, it’s a longer journey than it should be.

44. The Quantum Pontiff » Debug First? Says:

[…] After Scott confessed to still programming in BASIC, I had a good time recalling how I first learned to program. My first interaction with a computer and “programming” was through LOGO, that cute little program for programming a little turtle to draw graphics. Drawing cool and crazy pictures was fun! But I don’t really remember learning that as “programming” so much as it was learning geometry (I was in the second grade at the time) and I certainly recall sharing the computer (probably not very sharefully.) But the real way I learned to program was not through LOGO but through debuging! […]

45. Drew Arrowood Says:

When I teach intro to computers to liberal arts college students, I always show them how to use Javascript. The advantage is that hello, world requires only typing hello, world into notepad and saving a file. Typically, I also talk about the Windows Scripting Host , which uses that syntax to do interesting stuff on their machines.

My first programming (1978) was not by typing, however — though there were really neat Lanier word processors in my Dad’s chambers — it was recording 8-Track tapes that would play in a robot that would ask various questions of the user — I had to coordinate the timing just right, with a stopwatch (given to me by my Aunt Mary, who was a “Bosslady” in the Mill), yellow legal pads, and Skillcraft US Government Pens. My machine couldn’t do math, but it sure could pass the Turing Test!

46. agm Says:

Blake, I think it’s GOTO that’s considered harmful…

47. Sujit Says:

Thanks for this post, it brings back good memories. I remember playing Gorilla in sixth grade computing class and learning way more QBasic (and perhaps elementary projectile motion, too) trying to figure out the code than doing whatever it was we were supposed to be doing. These newfangled computer games just don’t cut it – Gorilla was 237 lines of code goodness…

48. jrl Says:

This reminds me of the first time I was expelled from high school. Of course the classical counterpart to QBASIC Gorilla was QBASIC Nibbles. In those days (the mid 90’s) the QBASIC games were loaded off of a Novel server; in any case, we broke into the network, and uploaded a modified Nibbles (the new title was “Nipples” and, well, you can imagine what modifications two teenage boys would come up with to go along with the name change). Innocent joke? Yeah, except we were suspended from school for the rest of the year…