Yegge: You know John Cage is the composer who pissed everyone off with his 4 minutes and 37 seconds composition which was a dude sitting at a piano for 4 minutes and 37 seconds.
Yegge: And not playing it, was it 33 ?
Yegge: Oh man, I'm 4 seconds out.
Spolsky: You just, well I think you might have your own new composition.
Yegge & Spolsky: <laughs>
Spolsky: Our guest today on the StackOverflow Podcast is Mr Steve Yegge.
Yegge: Howdy howdy.
Spolsky: Formerly of Amazon, and the Navy even before that, currently of Google in Kirkland where Michael and I are visiting. Jeff is on the line from Emeryville.
Atwood: Well actually El Cerrito but close, very close.
Yegge: It's foolish to, to, to try to ... I saw this dude, you know, hes not with us anymore and he left voluntarily, he was a good programmer, I mean people can get by with just basic V.I. But I mean the dude had, he was using not Vim, he was using V.I. Like Vi or whatever you call it, the old one. it was like Ed.
Spolsky: Ed. One comma three I <laughs>
Yegge: And I'd watch over his shoulder and i'd be like "Dude, you spelled it fuction again". Right ...
Spolsky: Doesn't—isn't there a problem that ... I know that in the case of IntelliSense, at least, it's very very hard to do good IntelliSense if you don't know the type that something is—that the variable is pointing at.
Yegge: Well, it is hard, but I notice that you didn't say it's impossible, and that's—that's the correct word, because it's not impossible.
Yegge: I don't know if we talk about it or anything. I know we're planning on open sourcing it—we're working on it.
Spolsky: Is it—is it the same as the one in Chrome?
Yegge: I don't know—no, it's not. The one in Chrome is a VM.
Spolsky: Oh, OK.
Yegge: It's a very—You know, it's kind of obfuscated—and it's not obfuscated...
Yegge: So there's classes, and there's methods, and inheritance, and there's even to some extent, you know, parameterized types and things like that.
Spolsky: Do you have to declare the types?
Yegge: You don't have to—there's type inference.
Yegge: So, the more types that you declare, especially at key points where there's a little bit of purchase for the type inference engine...
Spolsky: Yeah. Yeah.
Yegge: ...the better...
Yegge: …and it'll tell you, "Oh gosh, I have no idea what's going on here", right?
Yegge: …maybe it dispatches and does something different, you know?
Yegge: ...because they don't have overloading, right? So what you do is you just look at your arguments and see what you got and then do some dispatch, right?
Yegge: The type inference engine in JSCompiler will actually, like, figure out what all the possible things are that you do pass in, and create a union type for those, right?
Yegge: And none of this is ever surfaced in any sort of an IDE, or anything—it's just warnings or errors at build time, right?
Spolsky: So it can catch things faster.
Yegge: Yeah—but I mean, so it would be very nice if it could catch it as you typed it.
Spolsky: And plus, like, know what the type of that object is, so that... <overtalked>
Yegge: Absolutely. <overtalked> So that you could do—exactly—autocompletion, and things like that, right?
Yegge: ...I'm like, well, yeah. We have to write a Python compiler, you know..
Yegge: ...it's going to be some work. Because, the thing is, it's a very—it's a really sophisticated compiler. It does like 50 passes over the IR, and it does—it builds a, you know, control flow graph, and all that Dragon Book stuff, right?
Yegge: And it's starting—it's starting off with very few types. I mean, it's the types that you give it, right, but I mean, like, you could potentially, I mean, I think, eventually we're going to be able to run it on third-party code, where all—the only types are, like, you know, literals, and functions—you know, there isn't a type system, right? But it can still infer kind of a lot of stuff there, right?
Yegge: So, like, anyways, so, again, it's hard, it's a lot of work, and it could be better, and so on, but I mean it's pretty good. And then with C++, and with Java, and any statically typed language, you have types.
Yegge: So you have a lot of stuff for the IntelliJ...
Yegge: ...IntelliSense stuff to work.
Spolsky: And IntelliSense will almost work, and it'll use all kinds of exhaustive methods...
Spolsky: ...to try to guess what type things are.
Spolsky: Sometimes in ways that are maybe 95% accurate...
Yegge: And you know what?
Spolsky: <simultaneous> but not 100%...
Yegge: That's been my, sort of, core philosophy, is that if it's 95% accurate, then, you know, 5% of the time, you're going to be fixing it, you know...
Yegge: ...probably for C++, right? Every once in a while, it doesn't indent exactly the way you want, but as long as it's helping you...
Yegge: You know, um...
Spolsky: A lot of times, when it's failing, it's cuing you off as to something that you did nonstandard that's...
Yegge: That's true.
Spolsky: Or possibly even wrong.
Yegge: It could—you're right, it's actually kind of an incentive for you to sort of code in a more transparent way.
Yegge: "Your tool won't know what the hell you're doing."
Spolsky: Mm-hmm. <laughs>
Yegge: And that's your choice, right?