Any problem in computer science can be solved with another layer of indirection. But that usually will create another problem.
-- David Wheeler
Technorati tags: quote
Any problem in computer science can be solved with another layer of indirection. But that usually will create another problem.
-- David Wheeler


But it turned out to be a non-event. The people who didn't want to change stayed with the earlier version of the language, and those who moved forward saw the costs and the benefits, and opted for the benefits.
Apparently Ruby is also planning code-breaking changes to the language, primarily to take out the Perl-isms (a move I heartily applaud, and one that makes Ruby that much more attractive).
And the Java designers should certainly take notice, especially because the people they are so worried about offending with language incompatibilities are still using Java 1.1 with no plans to change; they aren't even paying attention to these discussions.
In the meantime, Java continues to ossify, pursuing its endless quest to produce the perfect program through static type checking, by adding more and more. The good thing is that people are finally beginning to see that static type checking is useful in small amounts and intrusive in large amounts (although I suspect this realization won't reach the main group of Java designers for years to come).
The bad thing is that, in the meantime, we get abominations like Java "generics"; via daily use people are finally beginning to see what I tried to explain years ago -- Java "generics" are far more painful than helpful, just like checked exceptions. But I digress.
T implements MyInterfaceT extends MyInterfacepublic interface Toto {
public void execute();
}
public class TotoImpl implements Toto {
public void execute() {
System.out.println("execute");
}
}
public class Foo <T extends Toto> {
private T t;
public void setObject(T t) {
this.t = t;
}
public T getObject() {
return t;
}
public void doSomething() {
t.execute();
}
}
public class Main {
public static void main(String[] args) {
Toto toto = new TotoImpl();
Foo foo = new Foo();
foo.setObject(toto);
Toto notCastedToto = foo.getObject();
foo.doSomething();
}
} 

