|
|
|
Sponsored Link •
|
|
Advertisement
|
Bill Venners: Last year when I interviewed you, you said, "by golly, you have to fulfill the contract."
Certainly if the next version of Java came out and they changed the meanings of all the methods in class String, it would
break everybody's code. You're not supposed to ever break those contracts. The idea of a contract is:
it's a contract. But are there situations in which I can sometimes bend a contract? Such as if nobody is actually using something,
or it doesn't hurt too many people?
James Gosling: This is messy, right? If you are writing a bunch of code and the API is not exposed to people in the outside world, if you have this contained universe where you can actually see all the bits and pieces that reference something, then you're actually in a really great situation. Because you can do the kind of thing you just talked about. You can say, "This guy was never getting used."
One of the nice things about Java is that, at least for the language parts, people were using Java for five years before we released it. And it went through a lot of really big changes, because although there was a developer community of about 20 people, I could find every piece of source code in the world. And that let me do experiments to find things out.
One of the things I did was there were some issues with goto. Java had a
goto at one point. I did this study of what people were doing with goto? And based on that
study of a half million lines of code, I just got rid of it.
At one point I was doing a revision to the set of bytecodes. So I found every constant and figured out what integers people use commonly, what floating point numbers people use. When you have a controlled universe, a contained universe, that is such a luxury. And that's why I have this tendency to not release things real soon. Because as soon as you have users, all of a sudden, you have this problem.
In your question, you asked, isn't it okay to change things if nobody is using it? That's fine. You should be able to change things if nobody's using it. The hard part is, how do you know if nobody's using it? And how do you evaluate the consequences of that change? And once your user community becomes this kind of unknowable group out there, then you have published this contract. You don't actually know which are the parts you get to dicker with and which are the parts you don't. You know what you've promised the world, and by God you've got to live by it.
|
Sponsored Links
|