Seibel: Do you feel at all that programming is a young person’s game?

Eich: I think young people have enormous advantages, just physiologicaladvantages to do with the brain. What they don’t have is the wisdom! Youget crustier and maybe you get slower but you do learn some painfullessons that you try to pass on to the next generation. I see them ignoringme and learning them the hard way, and I shake my fist!

But, apart from that, if you stay well-read and keep at it, your outputdoesn’t necessarily have to be voluminous. While producing a lot of code isstill important, what has interested me—and this is something that wetalked about at Netscape when we talked about their track for principalengineer—is somebody who isn’t management but still has enoughleadership or influence to cause other programmers to write code like theywould write without them having to do it, because you don’t have enoughhours in the day or fingers.

Having that ability to spread your approach and whatever you’ve learnedabout programming, and have that go through some kind of community andproduce a corpus of code that’s bigger than you could do, that’s as satisfyingto me as being the one that stays up all night writing too much code.

I’m still working too much, plus I’ve got small children. My wife is a goodsport but I don’t think she likes me traveling so much. But I’m doing some ofthat too. That’s not programming, yet it somehow has become important. Inthe case of JavaScript we have to figure out how to move the languageforward, and that requires some amount of not just evangelism, but gettingpeople to think about what would happen if the language did move, howwould you like it to move, where should it go. And then dealing with thecacophony of responses.

Not all programmers will say this, a lot of them are solitary, in the corner,but one of the things I realized at Netscape was that I liked interacting withpeople who actually use my code. And I would miss that if I went back intoa corner. I want to be grounded about this. I’m secure enough to think Icould go do something that was a fine sky castle for myself, but I’m realistenough to know that it would be only for myself and probably not fine forother people. And what’s the point? “If I’m only for myself”, you know,Hillel the elder, “what am I?”

I am not JavaScript. In the early days, it was such a rush job and it was buggyand then there was some Usenet post Jamie Zawinski forwarded me. Hesaid, “They’re calling your baby ugly.” I have real kids now; I don’t have toworry about that.

Joshua Bloch

Now Chief Java Architect at Google, Bloch previously was a Distinguished Engineerat Sun Microsystems, where he led the design and implementation of the JavaCollections Framework introduced in Java 2 and was involved in the design ofseveral language additions in the Java 5 release. He has a BS from ColumbiaUniversity and a PhD from Carnegie-Mellon University, where he worked on theCamelot distributed transaction processing system, which later became Encina, aproduct of Transarc, where he was a Senior Systems Designer. He wrote the 2001Jolt Award–winning book Effective Java and coauthored Java Puzzlers and JavaConcurrency in Practice.

As you might expect from someone whose job is to encourage the use of Java atGoogle, Bloch is a strong advocate of the language. Despite the recent flurry ofinterest in approaches to concurrency such as Software Transactional Memory orErlang’s message passing, Bloch thinks Java has “the best approach of anylanguage out there” to concurrency and predicts a resurgence of interest in Java asmore and more programmers are forced to deal with programming for machineswith multicore CPUs.

Bloch is also a strong advocate of treating programming as API design, and wetalked about how that affects his own design process, as well as whether Java hasgotten too complex and why picking a programming language is like picking a bar.

Seibel: How did you get into programming?

Bloch: I’m tempted to say it’s in the blood. My dad was a chemist atBrookhaven National Lab. When I was in fourth grade, he took aprogramming course. Back then, of course, machines were mainframesbehind glass windows and you handed your deck of cards to the operator. Itwasn’t hands-on, but I was just thrilled by the idea of these electroniccomputing machines that would do stuff for you. So I learned a little bit ofFortran from him while he was taking that course.

Seibel: This would have been what year?

Bloch: I think it was 1971. The bug didn’t really bite me until a coupleyears later. And what did it, of course, was timesharing. Long Island had aDECsystem-10, which was shared among all of the schools in SuffolkCounty. There was another one for Nassau County. It’s amazing how manywell-known people got their start on one of those two DECsystem-10s.

Once you have interactivity, the bug bites you. I was programming in BASIC,like everybody else back then, from about 1973 through 1976. That’s when Igot seriously into it. The amazing thing is, I still have programs from backthen on Teletype paper—that’s the medium that survived—and I look atthem and I can sort of see that bits and pieces of my style haven’t changedsince then.

Seibel: So what was the first interesting program that you rememberwriting?

Bloch: Well, I remember on July 4th, 1977 writing a version of the classicTwenty Questions game called “animals.” The program had a binary treewith yes-or-no questions at the interior nodes and animals at the leaves.When it first encountered a new animal, it “learned” the animal by askingthe user for a yes-or-no question to distinguish the new animal from theone it had incorrectly guessed. The binary tree was stored on disk so theprogram kept getting “smarter” over time.

I remember thinking, “My gosh, this is cool: the program actually learns.” Thatwas one sort of aha! moment for me. Another thing I remember was in highschool—10th grade, I think—on that DECsystem-10. We weren’t allowed to writewhat would now be called instant-messaging programs—they were thought to be toobig a drain on system resources.

Seibel: As they are, in fact, now.

Bloch: Don’t get me started. IM ruins my life. No, email ruins my life—IMis just a distraction. Anyway, being the bratty kid that I was, I entered aproject into the Long Island Math Fair on what I called “inter-jobcommunication programs.” I actually won a prize for it.

Seibel: And you actually wrote the programs?

Bloch: Yes. I wrote the programs, except for one that was contributed bya friend named Thomas De Bellis. The unique thing about Tom’s programwas that it was written entirely in BASIC. It was line-oriented, and used filesto communicate. It wasn’t fast or efficient, but it worked! I wrote two, oneline-oriented and one character-oriented. I wrote them in MACRO-10, thePDP-10 assembly language. They used a kind of shared memory called the“high segment” for the communication.

I didn’t know anything about concurrent programming back then. Iremember not really understanding mutexes. But there werecommunication buffers, and independent agents trying to communicate witheach other concurrently. So there were race conditions, and occasionallythe program lost a character or two. I wasn’t able to figure that out myselfas a high-school student.

Seibel: You say that you saw aspects of your current style in your earliestprograms. What are the bits that have stayed the same?

Bloch: My attempts to make my programs readable. As Knuth would say, aprogram is essentially a work of literature. For whatever reason, I realizedeven back then that a program has to be readable. And that hasn’t changed.


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