Seibel: So that was the first interesting code you read; what was the firstinteresting program you wrote?

Norvig: I guess it was probably the Game of Life. It was actually anassignment for the class. I quickly did the assignment, and of course then wedidn’t have the nice display screens. I didn’t have my 30-inch monitor—I hadthe teletype with the yellow paper. I said, “This is a waste, printing out onesmall field”—they probably wanted us to do a ten-by-ten field—“and thenprinting out the next one and the next one.” So I said, “Let’s print out fivegenerations in a row.” And I remember that you couldn’t have threedimensionalarrays in BASIC, and for some reason I couldn’t even have abunch of two-dimensional arrays. It’s like they ran out of memory orsomething. So I had to figure out how am I going to have five or six acrossof these two-dimensional arrays, and that’s when I discovered bit fields.

Seibel: So given the constraints on memory, you rolled your own storagefor that much data. Had you been taught about bit arrays and figured outhow to apply them, or did you go digging through the manual anddiscovered, “Oh, look, here’s this PEEK and POKE” or whatever it was?

Norvig: Well, I was storing a zero or one in each of these locations, and Ineeded to store more stuff somewhere, and I said, “Oh, store othernumbers there.” In fact, I don’t even remember if I did bit store. I might’vedone digits—decimal rather than binary—because the binary stuff hadn’treally been exposed to us in an interesting way. And then I got to add inthings, like, is it repeating and if so, with what cycle. You couldn’t do thatwhen you were just keeping one previous generation.

Seibel: When you were coming up as a programmer, did you do thingsspecifically to improve your skill as a programmer, or did you just program?

Norvig: I think I just programmed. Certainly I would do things because theywere fun. Especially when I was a grad student and I was less beholden toschedules. I’d say, “Oh, here’s an interesting problem. Let’s see if I can solvethat.” Not because it’s progress on my thesis, but just because it was fun.

Seibel: And you studied computers in college but didn’t major in computerscience, right?

Norvig: When I started, the computer classes were part of the appliedmathdepartment. By the time I graduated there actually was a computer sciencedepartment, but I stuck with math as my major. It felt like doing allthe requirements for a computer-science major was like majoring in IBM.You had to learn their assembly language, you had to learn their 360operating system, and so on. That didn’t seem like much fun. There weresome courses that I liked and I took those, but I didn’t want to go throughall the requirements.

After college I worked for two years, for a software company in Cambridge.And after two years I said, “It took me four years to get sick of school andonly two years to get sick of work, maybe I like school twice as much.”

Seibel: What were you doing for them?

Norvig: Their main product was a software-design tool set, and they alsodid software consulting of various kinds. The founders had worked atDraper Labs in Cambridge on the Apollo mission and other things like that;they had Air Force connections and they were a government contractor.They had this idea of how software should be designed. I never believed inthe whole idea, but it was fun.

I remember one of the projects we had there, at this company, was to writea flowchart drawer. The idea was that it would parse your program andgenerate a flowchart for it. Which was perfect because that’s the waypeople always use flowcharts. You’re supposed to write them ahead of timebut you really never do—you write them after the fact. And it was clever inthat it had a sort of partial grammar so you could take a program thatwasn’t even quite syntactically correct and it would gloss over the parts thatit couldn’t parse. It would have to know how to parse the IF statementsbecause those made different blocks and so on but the other stuff it justsaid, “Well, whatever is there just throw it into a block.” We got thiscontract to generate this thing and they specified that they wanted to run iton a Unix system. So we borrowed a machine at MIT and used all the Unixtools, yacc and stuff, for the compiler. And at the last minute they said, “No,we’re going to install it on a VMS system.” So all of the sudden, yacc wasn’tthere. But we said, “That’s OK, we don’t need it—we just needed it togenerate the tables and that’s done.”

Seibel: As long as your grammar never changes, you’re OK.

Norvig: Right, and so we delivered it and they were happy and then—ofcourse—the grammar changed. And we didn’t have access to any Unix machinesanymore. So I ended up having to patch the grammar by understanding the tablesand saying, “Here’s a jump to this other state—OK, I’ll invent a new state hereand jump to that one instead.”

Seibel: And was that really the right solution—did you ever consider justwriting a new parser?

Norvig: I probably should have. But, you know, it was just this one little fix.

Seibel: And you didn’t get caught in the trap of every three weeks theycome around with a new change to the grammar?

Norvig: Well, then I went off to grad school. Somebody else had theproblem and I don’t know what happened.

Seibel: Not your problem anymore. So you got your PhD. Is there anythingthat you wish you had done differently about how you learned to program?

Norvig: I ended up in industrial settings, so maybe I would’ve wished tohave done more of that earlier on. I did learn to do it, but I was in schooland in grad school for a long time. That was a lot of fun, too, so I don’t haveany regrets.

Seibel: What were the things you had to learn about industrialprogramming?

Norvig: About having schedules, and keeping team members andcustomers and managers happy. When you’re a grad student, you don’thave to do that; just show up to your adviser every now and then.

I guess the biggest change was going from one person to a team and figuringout how those kinds of interactions work. That’s something you don’tnormally get in school. I guess some of the schools are starting to bring thatinto the curriculum more. When I was in school, working as a team wascalled cheating.

Seibel: For people who are going into industry, are there other skills,beyond just the ability to write code, that people should develop?

Norvig: Getting along with people is the main thing. Being able tounderstand the customer is important: to know what it is you want to buildand whether what you have is right. Being able to interact with them andthen interact with your teammates. And interact with people higher up inthe company and your customers when you go out and see them. There areall different social relations and they require different skills.

Seibel: Has programming become a more social activity than it used to be?

Norvig: I think so. I think the computer used to be more segregated. Andin the old days it was mostly batch processing, so the interface was so muchsimpler. It was possible to do this kind of waterfall design where you said,“The input is going to be this deck of cards, and the output is going to be areport that has this number in this column.”

It probably wasn’t a very good idea to specify it that way. Probably rightfrom the start you should have had more interaction with the customer. Butit seemed more separable. Now everything seems more fluid and interactiveso it makes more sense to say, “Rather than have a complete specificationfrom the start, just get customers in the room and start brainstorming.”


Перейти на страницу:
Изменить размер шрифта: