Ingalls: I’d probably go in the less formal camp. Mainly out of that originalfeeling of having things be as absolutely simple as possible. I feel the samekinds of things about types. Types are essentially assertions about aprogram. And I think it’s valuable to have things be as absolutely simple aspossible, including not even saying what the types are. I think as you getmore serious about a system, it’s nice to be able to add all that stuff, andthere are ways of having your cake and eating it, too, such as inferring thetypes and not having to see them except when you want to see them.

And types are only one thing in a spectrum that includes units and all sortsof other assertions you can put on there. That’s part of the fascinating areawe have to explore with this synthetic mathematics. I think increasingly wecan take areas of computation and document them more and more withliving documentation, real programming documentation, so there areassertions there that really help you that you don’t usually see, but if you’restuck, you can start to bring them in and test various things about it.

Seibel: Do you have an opinion one way or the other on formally provingprograms correct?

Ingalls: It’s never been an occupation of mine. I’m inclined to focus on thearchitectural part that makes it easier to make assertions about things. So ifyou are allowed to do all sorts of dangerous things in a program, then whenyou sit down to do the formal proof, it’s very hard because at every stepyou’ve got to say, “Well, this could happen, that could happen, that couldhappen.” If the architecture is clean, then the formal proof may almost beobvious just by reading the code. You’ll say, “Well, this could only comefrom there. We’re safe.”

Seibel: Have you ever used C++?

Ingalls: No. Nor C.

Seibel: But you did BCPL and assembly, so it’s not like you’ve never usedlow-level languages.

Ingalls: Right. And I actually have done some C to debug things generatedby Squeak. But I remember when we did Squeak, part of my purpose was tohave a system that you really could be master of without having to knowanything but Squeak. So I made it my purpose to not ever learn that. JohnMaloney did the translator from Squeak to C in order to give us a practicalimplementation. The truth is, I would go in and look at that C code but Ipretty much made sure that you didn’t need to do any of that.

Seibel: You must’ve looked at C++ when it came out, as you were part ofthe group that—other than perhaps the Simula folks—can best claim tohave invented object-oriented programming.

Ingalls: I didn’t get that much into it. It seemed like a step forward invarious ways from C, but it seemed to be not yet what the promise was,which we were already experiencing. If I had been forced to do anotherbottom-up implementation, instead of using machine code I would’ve maybestarted with C++. And I know a couple of people who are masters of C++and I love to see how they do things because I think they don’t rely on it forthe stuff that it’s not really that good at but totally use it as almost ametaprogramming language.

Seibel: Let’s talk about code reading. How do you get into a new piece ofcode?

Ingalls: It’s hard for me to answer in the abstract. You start out knowingwhat it does or is supposed to do. I guess I go at it pretty much top-down—Ijust try to understand what the pieces are and how they work together. Seewhat classes and methods are defined and what they’re doing. Then it depends onwhy we’re looking. It could be it’s just something new and we want to find outabout it. It could be that it’s performing badly and then you do a profile ofit and look at that.

Seibel: We talked about Knuth before. His other passion is literateprogramming. Have you ever written literate code or read any?

Ingalls: I like to work that way with something where I’ve got the time tofinish it off. When I first write stuff, there are no comments. As soon as Ihave it working, I’ll write some comments. And if I like what I’ve done or itseems like it would be hard to figure out, I’ll write more comments. But Idon’t believe in putting comments beside everything. And I kind of feel likethe better a language is, the less you need comments. You use reasonablevariable names. That’s why I liked the keyword parameters in Smalltalk. Itreally makes things pretty readable. There’s this wonderful little hack thatyou can do in various places in JavaScript. It’s a little bit expensive, butJavaScript has this curly bracket object notation, and so you can usekeywords and they actually looks like Smalltalk keywords because they endwith colons, so you can have your multiple arguments be in a curly braceexpression. It actually makes nice-looking programs.

Seibel: Hmmm. That’s kind of beautiful and disgusting at the same time.

Ingalls: Yeah, right.

Seibel: Have you convinced anyone else to adopt that style?

Ingalls: The truth is I found somebody else doing that before I thought of itmyself.

Seibel: Do you consider yourself a scientist, an engineer, an artist, or acraftsman?

Ingalls: Really, all of those. I think my education as a physicist was good forme. A lot of that just has to do with looking at problems like physicalproblems, trying to isolate the forces on a body. It’s the same kind of thingyou use for looking at what all the ways are that something’s being used inthe system, how it could be affected. And it’s a very physical feeling I haveabout stuff that’s also really spatial—how things work together and howthings that might be different could be the same and how that would make abetter architecture.

I remember one of the early talks I had to give about Smalltalk; I said,“What we do in this group is like the scientific method, which is you makean observation, you come up with a theory to explain it, and you performan experiment to verify it.” And that’s very much what we did in thesuccessive generations of Smalltalk. We had a theory for how to makesomething work. We built a system that worked that way. We used it for awhile and we found out, “Oh, it’d be good if we did this and this and thisdifferently,” and we built a new one. So we kept going around that circle,which is just like scientific research and progress.

I feel like an artist when I’m working because I have this idea in my head andI just want to make it real. I imagine a sculptor having the same feeling,bringing a piece to life.

In this context, I view engineer and craftsman as being almost identical. It’sjust that an engineer is a craftsman in a technological field. There are timeswhen I feel that way, too, but they are different times—a very differenttime. It’s when I’m doing something low-level. From my history, I workedon the deepest parts of BitBlt or the Smalltalk byte-code engine and thoseare very craftsman-like things. And I had the luxury to do those over again acouple of times to get them really right and that’s a craft.

Seibel: The difference I see between engineers and craftsmen is theengineers are the folks who say, “We should be like the guys who buildbridges. Bridges don’t fall down. They have a repeatable engineeringprocess.” The craftsmen say, “This is more like woodworking. The wood isunique every time and there are rules of thumb but no method that canguarantee certain results.”

Ingalls: So in that regard I may be less of an engineer. I think that the waysin which I stress systems are different. I know there are people who doserious enterprise programming systems. That’s not a focus or a passion ofmine. Of the four you mentioned, the engineer is probably the least, thencraftsman, and then this funny combination between artist and scientist atthe top.


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