Seibel: People are going to hate you when you discover that actually, reallytiny monitors make people more productive.

Norvig: Right. And if providing quiet is important, then you shouldprobably do that, but on the other hand, if providing communicationbetween team members is important, then you should do that, and how doyou balance those two?

I just started thinking about what’s the right way to do that. How do you setup an experiment? What do you track? Do we have numbers already thatwe could make use of just by adding in some kind of questionnaire? Do wehave to set up an experiment?

Seibel: It’s often claimed that there are orders of magnitude differences inproductivity between programmers. Yet I read somewhere some criticismof those claims, saying the studies that found that were done quite sometime ago, and a lot of things have changed about programming since thenthat could have accounted for the differences—such as some people in thestudy were still using batch processing techniques while other people wereusing timesharing programming environments.

Norvig: I don’t think that’s all of it, because I think there were somedifferences within the same organization using more of the same tools. I alsoremember there were criticisms of some of the studies of findingcorrelation, but not knowing cause and effect. If you found that theprogrammers in the big corner offices were more productive, is thatbecause you reward the good programmers with the offices, or is it becausethe offices makes them better? You can’t really come to a conclusion.

Seibel: Do you still enjoy programming as much as when you were startingout?

Norvig: Yeah, but it’s frustrating to not know everything. I’m not doing itas much, so I forget a little bit. And there are all these new things. I reallyshould redesign my web site and it should have JavaScript on the client side.It should have PHP or something like that, and I just haven’t gotten up themomentum to learn all that stuff and be able to do it.

Seibel: Do you think programming is a young person’s game?

Norvig: I think it helps in some ways. We certainly have a range of peoplehere that are exceptionally good at all levels and all ages. I think theadvantage of being young is it’s important to grasp the whole program, thewhole problem, in your head—being able to concentrate. And I think that’seasier when you’re younger, because your brain is better at it, or maybe it’sjust that you have less distractions. If you have kids, and family, and so on,you just can’t devote as many consecutive hours as when you don’t. Sothat’s part of it. But on the other hand, you’ve got this range of experience,so you can make up for that in some ways by being able to do morebecause you know how to do it.

Seibel: One of the aspects of the modern style of programming, as youwere saying, is that programmers have to absorb things quickly. How doyou tackle the problem of understanding a big pile of code, none of whichyou’ve ever seen before?

Norvig: I think you do a mix of statically and dynamically. You start readingthe code and trying to make sense of it and then you get some traces ofwhat calls what, and where most of time is spent, and what’s the flowthrough it. Then try to do something. Say, “I’m going to make this triviallittle change.” Or go to the issues database and say, “I’ll take this one.” Inorder to do that, I have to learn a little piece of it. There’s only a little piece,but you get that done and you move on to the next one.

Seibel: Have you ever done literate programming a la Knuth?

Norvig: I never used his tools per se. I’ve certainly written macros and soon. And I’ve used the Java docs and things like that. In many ways, Lispprogramming encourages you to make your own system as you go, and so itends up being literate in that way. You find your own macros for your ownapplication-specific programming, and part of that is the documentation, partof it’s the data, and part of it’s the code, so I’ve certainly done that. Thenmore recently, in whatever language I’m using, whether it’s Java, or Python,or whatever, I’ve certainly been careful to write test cases, and documentaround that.

You look at Knuth’s original Literate Programming, and he was really trying tosay, “What’s the best order for writing a book,” assuming that someone’sgoing to read the whole book and he wants it to be in a logical order.People don’t do that anymore. They don’t want to read a book. They wantan index so they can say, “What’s the least amount of this book that I haveto read? I just want to find the three paragraphs that I need. Show me thatand then I’ll move on.” I think that’s a real change.

Seibel: I wonder if there isn’t a way to write modern-style literateprogramming. Certainly Knuth’s tools give you an index and beautiful crossreferencing.I wonder if perhaps a modern approach to literateprogramming just would organize the book differently—both as a wholeprogram and as a bunch of pieces that you can understand in bits?

Norvig: I don’t know. I think he was solving a problem that doesn’t existanymore to a large degree. Part of it was because he wanted to put it in alinear order rather than in a web-like or a searchable order. I think part of itwas the limitations. I think he was using Pascal originally. And there it’spretty strict in terms of what had to be declared first and not necessarily inthe order you want. Modern languages are more free in that order, so Ithink it’s less of an issue now.

Seibel: You mentioned reading Strachey’s checkers code in ScientificAmerican. And in your “Teach Yourself Programming in Ten Years” essay,you talk about the importance of reading code. What code did you readcoming up?

Norvig: I read a lot of the Symbolics’s code, because that was availablewhen I was at Berkeley.

Seibel: Was that just because it was available and was interesting? Or wereyou reading it to try to understand some behaviors you were observing?

Norvig: Both. I sometimes just tried to figure out how things work andsometimes I needed it to solve a problem.

Seibel: So when you’re reading just for general edification, how do youapproach that?

Norvig: I think it’s probably interest-driven. “Gee, this file system allowsyou to read files across the net using the same protocol that you use locallyon your machine—I wonder how it does that?” And so you’ll say, “Maybeit’s in the open function.” You look there, and say, “Oh, that calls this otherthing.” And you look there, and eventually you say, “Oh, this is how it doesit.”

Seibel: Have you read any of Knuth’s literate programs in book form?

Norvig: I’ve certainly picked up the books and flipped through them. Icould say I glanced at them, but I haven’t studied them.

Seibel: What about The Art of Computer Programming? Some of the peopleI’ve talked to on this have absolutely read it from cover to cover. Somepeople have it on the shelf and use it as a reference. And some people justhave it on the shelf.

Norvig: At one point I had it as my monitor stand because it was one ofthe biggest set of books I had, and it was just the right height. That was nicebecause it was always there, and I guess then I was more prone to use it asa reference because it was just right in front of me.

Seibel: But you had to lift up the monitor every time you wanted to look atit?

Norvig: No, I had the box set. You had to pull hard, but you could pull oneof the box. Now I’m less likely to use any book for reference—I’m justlikely to do a search.

Seibel: Just because it’s more convenient?

Norvig: It’s convenient. I think it’s also that I’m probably more goaloriented.Knuth is good if you say, “I want to know everything about thissubject.” But usually I’m saying, “I want to know if A is better than B,” or, “Iwant to know the asymptotic complexity of this, and once I’ve got that, Idon’t need all the details of how we got there.”


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